diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2023-10-07 17:15:31 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2023-10-07 17:15:31 +0200 |
| commit | ff81b5438f280a59ca1825bfdf120d8f256bd154 (patch) | |
| tree | 0a63ea3eb9fc28ca655c3ca3d1c70000d514aecd /source/boot/arch | |
| parent | 7e785ff5a7a2e9c98fd1679e74a728f4babf722a (diff) | |
| download | teachos-ff81b5438f280a59ca1825bfdf120d8f256bd154.tar.xz teachos-ff81b5438f280a59ca1825bfdf120d8f256bd154.zip | |
x86_64: implement very simple VGA text output
Diffstat (limited to 'source/boot/arch')
| -rw-r--r-- | source/boot/arch/x86_64/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | source/boot/arch/x86_64/include/boot/pointers.hpp | 12 | ||||
| -rw-r--r-- | source/boot/arch/x86_64/src/boot.s | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/source/boot/arch/x86_64/CMakeLists.txt b/source/boot/arch/x86_64/CMakeLists.txt index 0fd6539..14b0610 100644 --- a/source/boot/arch/x86_64/CMakeLists.txt +++ b/source/boot/arch/x86_64/CMakeLists.txt @@ -4,3 +4,7 @@ target_sources("_boot" PRIVATE "src/crtn.s" "src/multiboot.s" ) + +target_include_directories("_boot" PUBLIC + "include" +)
\ No newline at end of file diff --git a/source/boot/arch/x86_64/include/boot/pointers.hpp b/source/boot/arch/x86_64/include/boot/pointers.hpp new file mode 100644 index 0000000..f4f504c --- /dev/null +++ b/source/boot/arch/x86_64/include/boot/pointers.hpp @@ -0,0 +1,12 @@ +#ifndef TEACHOS_ARCH_X86_64_BOOT_POINTERS_HPP +#define TEACHOS_ARCH_X86_64_BOOT_POINTERS_HPP + +#include <cstddef> + +namespace teachos::boot +{ + extern "C" std::byte const multiboot_information_pointer; + extern "C" std::byte * vga_buffer_pointer; +} // namespace teachos::boot + +#endif
\ No newline at end of file diff --git a/source/boot/arch/x86_64/src/boot.s b/source/boot/arch/x86_64/src/boot.s index 4781773..45f261e 100644 --- a/source/boot/arch/x86_64/src/boot.s +++ b/source/boot/arch/x86_64/src/boot.s @@ -103,6 +103,7 @@ mesage_long_mode_not_supported: /** * We need a pointer to our current position in the VGA text buffer. */ +.global vga_buffer_pointer vga_buffer_pointer: .long 0xb8000 /** @@ -369,6 +370,5 @@ _transition_to_long_mode: call _init - mov multiboot_information_pointer, %rdi call kernel_main hlt |
