Skip to content
Snippets Groups Projects
Commit 5651f632 authored by Overpeek's avatar Overpeek
Browse files

pure rust base

parent 1740fc30
No related branches found
No related tags found
No related merge requests found
Showing
with 369 additions and 585 deletions
[target.x86_64-unknown-none]
runner = "echo"
# the target x86_64-unknown-none has
# to be overwritten with the host target
#
# unfortunately it seems like there is
# no way to 'unset' the target set >>>
runner = "cargo run --package=boot --target=x86_64-unknown-linux-gnu"
# <<< here
#
# note: this target is important
[build]
target = "x86_64-unknown-none"
target-dir = "target"
[alias]
image = "run -- --no-run"
/target
# Added by cargo
#
# already existing elements were commented out
#/target
# Added by cargo
#
# already existing elements were commented out
#/target
......@@ -3,5 +3,208 @@
version = 3
[[package]]
name = "kernel"
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bit_field"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "boot"
version = "0.1.0"
dependencies = [
"bootloader-locator",
"locate-cargo-manifest",
"runner-utils",
]
[[package]]
name = "bootloader"
version = "0.10.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24e13520aa8580a2850fc9f5390dc6753f1062fb66f90e5a61bd5c72b55df731"
[[package]]
name = "bootloader-locator"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aaaa9db3339d32c2622f2e5d0731eb82a468d3439797c9d4fe426744fe2bd551"
dependencies = [
"json",
]
[[package]]
name = "json"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd"
[[package]]
name = "libc"
version = "0.2.134"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb"
[[package]]
name = "locate-cargo-manifest"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db985b63431fe09e8d71f50aeceffcc31e720cb86be8dad2f38d084c5a328466"
dependencies = [
"json",
]
[[package]]
name = "lock_api"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]]
name = "proc-macro2"
version = "1.0.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [
"proc-macro2",
]
[[package]]
name = "ros"
version = "0.1.0"
dependencies = [
"bootloader",
"spin",
"uart_16550",
"x86_64",
]
[[package]]
name = "runner-utils"
version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9dc6848b056990cd51e72aa5556bdbea4a96013e8b18635d183c84159c2988f"
dependencies = [
"thiserror",
"wait-timeout",
]
[[package]]
name = "rustversion"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8"
[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "spin"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09"
dependencies = [
"lock_api",
]
[[package]]
name = "syn"
version = "1.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "uart_16550"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b074eb9300ad949edd74c529c0e8d451625af71bb948e6b65fe69f72dc1363d9"
dependencies = [
"bitflags",
"rustversion",
"x86_64",
]
[[package]]
name = "unicode-ident"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
[[package]]
name = "volatile"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3ca98349dda8a60ae74e04fd90c7fb4d6a4fbe01e6d3be095478aa0b76f6c0c"
[[package]]
name = "wait-timeout"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
dependencies = [
"libc",
]
[[package]]
name = "x86_64"
version = "0.14.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "100555a863c0092238c2e0e814c1096c1e5cf066a309c696a87e907b5f8c5d69"
dependencies = [
"bit_field",
"bitflags",
"rustversion",
"volatile",
]
[package]
name = "kernel"
name = "ros"
version = "0.1.0"
edition = "2021"
build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
#[lib]
#crate-type = ["staticlib"]
[workspace]
members = [
"boot",
]
[dependencies]
bootloader = "0.10.13"
spin = "0.9.4"
uart_16550 = "0.2.18"
x86_64 = "0.14.10"
# target specific
TARGET = x86_64-unknown-none
QEMU = qemu-system-x86_64
CONFIG = x86_64
EXTRA_RUSTFLAGS =
KERNEL = kernel
KERNEL_ELF = target/$(TARGET)/release/$(KERNEL)
DEBUG_KERNEL_ELF = target/$(TARGET)/debug/$(KERNEL)
KERNEL_LIB = target/$(TARGET)/release/lib$(KERNEL).a
DEBUG_KERNEL_LIB = target/$(TARGET)/debug/lib$(KERNEL).a
OS_ISO = target/$(TARGET)/release/$(KERNEL).iso
DEBUG_OS_ISO = target/$(TARGET)/debug/$(KERNEL).iso
LD_SCRIPT_PATH = $(shell pwd)/src/arch/x86_64
LD_SCRIPT = kernel.ld
KERNEL_DEPS = $(filter-out %: ,$(file < $(KERNEL_ELF).d))
DEBUG_KERNEL_DEPS= $(filter-out %: ,$(file < $(DEBUG_KERNEL_ELF).d))
BOOT_SRC = $(shell find $(LD_SCRIPT_PATH)/boot -name *.asm)
BOOT_OBJ = $(patsubst $(LD_SCRIPT_PATH)/boot/%.asm, $(LD_SCRIPT_PATH)/boot/%.o, $(BOOT_SRC))
CARGO_DEPS = $(LD_SCRIPT_PATH)/$(LD_SCRIPT) Cargo.toml
RUSTFLAGS = $(EXTRA_RUSTFLAGS) \
-C link-arg=--library-path=$(LD_SCRIPT_PATH) \
-C link-arg=--script=$(LD_SCRIPT)
# -C relocation-model=static
CARGO_BUILD_DEBUG= cargo rustc --target=$(TARGET)
CARGO_BUILD = $(CARGO_BUILD_DEBUG) --release --verbose
#DEBUGGER = lldb $(DEBUG_KERNEL_ELF) -o "gdb-remote localhost:1234"
DEBUGGER = gdb $(DEBUG_KERNEL_ELF) --eval-command "target remote localhost:1234"
.PHONY: build run debug
# compile asm
$(BOOT_OBJ): $(BOOT_SRC) Makefile
@echo "Compiling boot assembly"
@for asm in ${BOOT_SRC}; do nasm -f elf64 $$asm; done
# compile kernel
$(KERNEL_ELF): $(KERNEL_DEPS) $(CARGO_DEPS) Makefile
@echo "Compiling kernel lib"
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO_BUILD)
# compile debug kernel
$(DEBUG_KERNEL_ELF): $(DEBUG_KERNEL_DEPS) $(CARGO_DEPS) Makefile
@echo "Compiling debug kernel ELF"
@RUSTFLAGS="$(RUSTFLAGS)" $(CARGO_BUILD_DEBUG)
# generate grub iso
$(OS_ISO): $(KERNEL_ELF) Makefile
@echo "Generate os iso"
@cp $< iso/boot/kernel
@grub-mkrescue /usr/lib/grub/i386-pc -o $@ iso > /dev/null 2>&1
# generate debug grub iso
$(DEBUG_OS_ISO): $(DEBUG_KERNEL_ELF) Makefile
@echo "Generate debug os iso"
@cp $< iso/boot/kernel
@grub-mkrescue /usr/lib/grub/i386-pc -o $@ iso > /dev/null 2>&1
# just compile the kernel
build: $(KERNEL_ELF) Makefile
@echo "$<"
# compile and run silently
run: $(OS_ISO) Makefile
@echo "Running kernel in QEMU"
@$(QEMU) $< &> /dev/null
# compile, run and start gdb
debug: $(DEBUG_KERNEL_ELF) $(DEBUG_OS_ISO) Makefile
@echo "Debugging kernel in QEMU"
@$(QEMU) $(DEBUG_OS_ISO) -s -no-reboot &> /dev/null
# wait for qemu to be ready
@sleep 1
@$(DEBUGGER)
[package]
name = "boot"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bootloader-locator = "0.0.4"
locate-cargo-manifest = "0.2.2"
runner-utils = "0.0.2"
// source:
// https://github.com/rust-osdev/bootloader/blob/515a7ecb4a045836dc92b2cc98d9bc45d7c95c90/examples/test_framework/boot/src/main.rs
use std::{
path::{Path, PathBuf},
process::{Command, ExitStatus},
time::Duration,
};
//
const RUN_ARGS: &[&str] = &["--no-reboot", "-s"];
const TEST_ARGS: &[&str] = &[
"-device",
"isa-debug-exit,iobase=0xf4,iosize=0x04",
"-serial",
"stdio",
"-display",
"none",
"--no-reboot",
];
const TEST_TIMEOUT_SECS: u64 = 10;
//
fn main() {
let mut args = std::env::args().skip(1); // skip executable name
let kernel_binary_path = {
let path = PathBuf::from(args.next().unwrap());
path.canonicalize().unwrap()
};
let no_boot = if let Some(arg) = args.next() {
match arg.as_str() {
"--no-run" => true,
other => panic!("unexpected argument `{}`", other),
}
} else {
false
};
let bios = create_disk_images(&kernel_binary_path);
if no_boot {
println!("Created disk image at `{}`", bios.display());
return;
}
let mut run_cmd = Command::new("qemu-system-x86_64");
run_cmd
.arg("-drive")
.arg(format!("format=raw,file={}", bios.display()));
let binary_kind = runner_utils::binary_kind(&kernel_binary_path);
if binary_kind.is_test() {
run_cmd.args(TEST_ARGS);
let exit_status = run_test_command(run_cmd);
match exit_status.code() {
Some(33) => {} // success
other => panic!("Test failed (exit code: {:?})", other),
}
} else {
run_cmd.args(RUN_ARGS);
let exit_status = run_cmd.status().unwrap();
if !exit_status.success() {
std::process::exit(exit_status.code().unwrap_or(1));
}
}
}
fn run_test_command(mut cmd: Command) -> ExitStatus {
runner_utils::run_with_timeout(&mut cmd, Duration::from_secs(TEST_TIMEOUT_SECS)).unwrap()
}
pub fn create_disk_images(kernel_binary_path: &Path) -> PathBuf {
let bootloader_manifest_path = bootloader_locator::locate_bootloader("bootloader").unwrap();
let kernel_manifest_path = locate_cargo_manifest::locate_manifest().unwrap();
let mut build_cmd = Command::new(env!("CARGO"));
build_cmd.current_dir(bootloader_manifest_path.parent().unwrap());
build_cmd.arg("builder");
build_cmd
.arg("--kernel-manifest")
.arg(&kernel_manifest_path);
build_cmd.arg("--kernel-binary").arg(&kernel_binary_path);
build_cmd
.arg("--target-dir")
.arg(kernel_manifest_path.parent().unwrap().join("target"));
build_cmd
.arg("--out-dir")
.arg(kernel_binary_path.parent().unwrap());
build_cmd.arg("--quiet");
if !build_cmd.status().unwrap().success() {
panic!("build failed");
}
let kernel_binary_name = kernel_binary_path.file_name().unwrap().to_str().unwrap();
let disk_image = kernel_binary_path
.parent()
.unwrap()
.join(format!("boot-bios-{}.img", kernel_binary_name));
if !disk_image.exists() {
panic!(
"Disk image does not exist at {} after bootloader build",
disk_image.display()
);
}
disk_image
}
fn main() {}
/kernel
set timeout=0
set default=0
menuentry "kernel" {
multiboot2 /boot/kernel
boot
}
[toolchain]
channel = "nightly"
use core::arch::global_asm;
global_asm!(include_str!("boot.s"));
// global_asm!(include_str!("boot/check.asm"));
// global_asm!(include_str!("boot/header.asm"));
// global_asm!(include_str!("boot/long.asm"));
// global_asm!(include_str!("boot/main.asm"));
// global_asm!(include_str!("boot/memory.asm"));
// global_asm!(include_str!("boot/setup.asm"));
// x86_64 multiboot2 kernel start
KERNEL_BASE = 0xFFFFFFFF80000000;
;
/*
Multiboot header
*/
.section .multiboot_header, "a"
.align 4
.global header_start
header_start:
// magic number (multiboot2)
.int 0xE85250D6
// arch (protected mode i386)
.int 0
// header length
.int header_end - header_start
// checksum
.int 0x100000000 - (0xe85250d6 + 0 + header_end - header_start)
// end tag
.word 0
.word 0
.int 8
header_end:
/*
protected mode start
*/
.section .inittext, "ax"
.global start
.code32
start:
mov multiboot_sig - KERNEL_BASE, eax
mov multiboot_ptr - KERNEL_BASE, ebx
mov eax, cr4
or eax, 0x80|0x20|0x10
mov cr3, eax
halt:
hlt
jmp halt
.section .text
.globl start64
start64:
mov esp, stack_top
.section .bss
.align 4096
.code64
// page tables
p4_table: // PML4
// .quad p3_table + 3
// .rept 512 - 3
// .quad
// .endr
// .quad 0
// .quad p2_table + 3
.skip 4096
p3_table: // PDP
// .quad
.skip 4096
p2_table: // PD
.skip 4096
p1_table: // PT
// 16 KiB stack
stack_bottom:
.skip 4096 * 4
stack_top:
.section .data
multiboot_sig:
.long 0
multiboot_ptr:
.long 0
// TODO: global descriptor table
/*.section .rodata
gdt64:
.long 0 ; zero entry
.code_segment: equ $ - gdt64
.long (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53)
.pointer:
.word $ - gdt64 - 1
.long gdt64*/
// x86_64 multiboot2 kernel start
/*
Multiboot header
*/
.section .multiboot_header, "a"
.align 4
.global header_start
header_start:
// magic number (multiboot2)
.int 0xE85250D6
// arch (protected mode i386)
.int 0
// header length
.int header_end - header_start
// checksum
.int 0x100000000 - (0xe85250d6 + 0 + header_end - header_start)
// end tag
.word 0
.word 0
.int 8
header_end:
/*
protected mode start
*/
.section .inittext, "ax"
.global start
.code32
start:
// setup stack
mov esp, stack_top
// checks
call check_multiboot
call check_cpuid
call check_long_mode
// setups
call setup_page_tables
call enable_paging
// TODO: GDT before long mode
// lgdt [gdt64.pointer]
// jmp gdt64.code: start64
jmp start64
jmp halt
error:
// print 'ERR: <err>'
mov dword ptr [0xb8000], 0x4f524f45
mov dword ptr [0xb8004], 0x4f3a4f52
mov dword ptr [0xb8008], 0x4f204f20
mov byte ptr [0xb800a], al
jmp halt
halt:
cli
// print 'ZZZ' as halting
mov word ptr [0xb8f00], 0x0f5a
mov word ptr [0xb8f02], 0x0f5a
mov word ptr [0xb8f04], 0x0f5a
halt_repeat:
hlt
jmp halt_repeat
/*
checks
*/
// check if booted from a multiboot
// compliant bootloader
check_multiboot:
cmp eax, 0x36d76289
jne .no_multiboot
ret
.no_multiboot:
mov al, 'M'
jmp error
// check for cpuid instruction availability
// requirement for checking long mode support
check_cpuid:
pushfd
pop eax
mov ecx, eax
xor eax, 1 << 21
push eax
popfd
pushfd
pop eax
push ecx
popfd
cmp eax, ecx
je .no_cpuid
ret
.no_cpuid:
mov al, 'C'
jmp error
// check for long mode availability
// requires cpuid instruction availability
check_long_mode:
mov eax, 0x80000000
cpuid
cmp eax, 0x80000001
jb .no_long_mode
mov eax, 0x80000001
cpuid
test edx, 1 << 29
jz .no_long_mode
ret
.no_long_mode:
mov al, 'L'
jmp error
/*
setups - page tables, paging, long mode
*/
// btw without these two next lines,
// the setup_page_tables and .no_long_mode
// gets corrupted for what ever reason
//
// even tho the section is the same already
// and the bits mode is already 32
setup_page_tables:
mov eax, p3_table
or eax, 0b11 // present, writeable
mov [p4_table], eax
mov eax, p2_table
or eax, 0b11 // present, writeable
mov [p3_table], eax
mov ecx, 0 // counter
.loop:
mov eax, 0x200000 // 2MiB
mul ecx
or eax, 0b10000011 // present, writeable, huge page
mov [p2_table + ecx * 8], eax
inc ecx // inc counter
cmp ecx, 512 // check if the whole table is mapped
jne .loop // if not: continue
hlt
ret
enable_paging:
// pass page table location to the cpu
mov eax, p4_table
mov cr3, eax
// enable PAE
mov eax, cr4
or eax, 1 << 5
mov cr4, eax
// enable long mode
mov ecx, 0xC0000080
rdmsr
or eax, 1 << 8
wrmsr
// enable paging
mov eax, cr0
or eax, 1 << 31
mov cr0, eax
ret
nop
/*
Start in long mode and jump to the
kernel_main in main.rs
*/
.section .text
.code64
start64:
mov ax, 0
mov ss, ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
// print 'OK'
mov dword ptr [0xb8000], 0x2f4b2f4f
call kernel_main
jmp halt
/*
memory
*/
.section .bss
.align 4096
.code64
// page tables
p4_table: // PML4
// .quad p3_table + 3
// .rept 512 - 3
// .quad
// .endr
// .quad 0
// .quad p2_table + 3
.skip 4096
p3_table: // PDP
// .quad
.skip 4096
p2_table: // PD
.skip 4096
p1_table: // PT
// 16 KiB stack
stack_bottom:
.skip 4096 * 4
stack_top:
// TODO: global descriptor table
/*.section .rodata
gdt64:
.long 0 ; zero entry
.code_segment: equ $ - gdt64
.long (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53)
.pointer:
.word $ - gdt64 - 1
.long gdt64*/
/*.o
global check_multiboot, check_cpuid, check_long_mode
extern error
section .text
bits 32
; multiboot check
check_multiboot:
cmp eax, 0x36d76289
jne .no_multiboot
ret
.no_multiboot:
mov al, "M"
jmp error
; cpuid check
check_cpuid:
pushfd
pop eax
mov ecx, eax
xor eax, 1 << 21
push eax
popfd
pushfd
pop eax
push ecx
popfd
cmp eax, ecx
je .no_cpuid
ret
.no_cpuid:
mov al, "C"
jmp error
; long mode check
check_long_mode:
mov eax, 0x80000000
cpuid
cmp eax, 0x80000001
jb .no_long_mode
mov eax, 0x80000001
cpuid
test edx, 1 << 29
jz .no_long_mode
ret
.no_long_mode:
mov al, "L"
jmp error
\ No newline at end of file
section .multiboot_header
header_start:
; magic number (multiboot2)
dd 0xe85250d6
; arch (protected mode i386)
dd 0
; header length
dd header_end - header_start
; checksum
dd 0x100000000 - (0xe85250d6 + 0 + header_end - header_start)
; end tag
dw 0
dw 0
dd 8
header_end:
\ No newline at end of file
global long_mode_start
extern kernel_main
section .text
bits 64
long_mode_start:
mov ax, 0
mov ss, ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
; print 'OK'
mov dword [0xb8000], 0x2f4b2f4f
call kernel_main
hlt
\ No newline at end of file
global start, error
extern check_multiboot, check_cpuid, check_long_mode
extern setup_page_tables, enable_paging
extern stack_top, gdt64.pointer, gdt64.code_segment
extern long_mode_start
section .text
bits 32
start:
mov esp, stack_top
; checks
call check_multiboot
call check_cpuid
call check_long_mode
; setups
call setup_page_tables
call enable_paging
lgdt [gdt64.pointer]
jmp gdt64.code_segment: long_mode_start
jmp halt
error:
; print 'ERR: <err>'
mov dword [0xb8000], 0x4f524f45
mov dword [0xb8004], 0x4f3a4f52
mov dword [0xb8008], 0x4f204f20
mov byte [0xb800a], al
jmp halt
halt:
; halt the CPU
mov word [0xb8f00], 0x0f5a
mov word [0xb8f02], 0x0f5a
mov word [0xb8f04], 0x0f5a
hlt
\ No newline at end of file
global page_table_l4, page_table_l3, page_table_l2
global stack_top
global gdt64.pointer, gdt64.code_segment
section .bss
align 4096
; page tables
page_table_l4:
resb 4096
page_table_l3:
resb 4096
page_table_l2:
resb 4096
; stack
stack_bottom:
resb 4096 * 4
stack_top:
; global descriptor table
section .rodata
gdt64:
dq 0 ; zero entry
.code_segment: equ $ - gdt64
dq (1 << 43) | (1 << 44) | (1 << 47) | (1 << 53)
.pointer:
dw $ - gdt64 - 1
dq gdt64
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment