aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/CMakeLists.txt
blob: 84519453c9e9924e26abc90f4c4600004a3d418d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
add_library("x86_64" OBJECT)
add_library("os::arch" ALIAS "x86_64")

target_include_directories("x86_64" PUBLIC
    "include"
)

target_link_libraries("x86_64" PUBLIC
    "os::kapi"
    "libs::multiboot2"
)

target_sources("x86_64" PRIVATE
    # Low-level bootstrap
    "src/boot/boot32.S"
    "src/boot/entry64.s"
    "src/boot/initialize_runtime.cpp"
    "src/boot/multiboot.s"

    # api::kapi implementation
    "src/kapi/cio.cpp"
    "src/kapi/cpu.cpp"
    "src/kapi/memory.cpp"

    # Memory management
    "src/memory/mmu.cpp"
    "src/memory/page_table.cpp"
    "src/memory/paging_root.cpp"
    "src/memory/region_allocator.cpp"

    # VGA text mode
    "src/vga/text.cpp"
)

target_sources("x86_64" PRIVATE
    FILE_SET HEADERS
    BASE_DIRS "include"
    FILES
    # Low-level bootstrap
    "include/x86_64/boot/boot.hpp"
    "include/x86_64/boot/ld.hpp"

    # Low-level CPU access
    "include/x86_64/cpu/registers.hpp"
    "include/x86_64/cpu/impl/control_registers.hpp"
    "include/x86_64/cpu/impl/model_specific_register.hpp"

    # Low-level device I/O
    "include/x86_64/device_io/port_io.hpp"

    # Memory management
    "include/x86_64/memory/mmu.hpp"
    "include/x86_64/memory/page_table.hpp"
    "include/x86_64/memory/paging_root.hpp"
    "include/x86_64/memory/region_allocator.hpp"

    # VGA I/O
    "include/x86_64/vga/text.hpp"
)

set(KERNEL_LINKER_SCRIPT
    "${CMAKE_CURRENT_SOURCE_DIR}/scripts/kernel.ld"
    PARENT_SCOPE
)