move gdt, use fixed addr
This commit is contained in:
1 parent
f0289cd753
commit
da6f981a6a
3 files changed
+4
-6
No files matched your search
+1
-1
@@ -9,7 +9,7 @@
|
||||
%define S2_DATA S2_LOAD_ADDR
|
||||
%define S2_ENTRYPOINT (S2_DATA_ADDR + S2_DATA_LEN)
|
||||
|
||||
%define GDT_ADDR 0xc000
|
||||
%define GDT_FLAT_ADDR 0xe000
|
||||
%define S3_LOAD_ADDR 0x10000
|
||||
|
||||
; %define MEMMAP 0x6a00
|
||||
|
||||
+2
-4
@@ -39,7 +39,7 @@ s2_main:
|
||||
; Copy the GDT
|
||||
mov cx, GDT_FLAT_LEN
|
||||
mov si, gdt_flat
|
||||
mov di, GDT_ADDR
|
||||
mov di, GDT_FLAT_ADDR
|
||||
rep movsb
|
||||
|
||||
; Ensure interrupts are definitely disabled.
|
||||
@@ -86,9 +86,7 @@ section .s3_data
|
||||
|
||||
gdt_flat_slice:
|
||||
dw GDT_FLAT_LEN
|
||||
dd gdt_flat
|
||||
|
||||
global gdt_flat_slice
|
||||
dd GDT_FLAT_ADDR
|
||||
|
||||
; Segment descriptor layout
|
||||
; | Range (bits) | Field |
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ pub extern "C" fn _start() -> ! {
|
||||
com::try_com1_init();
|
||||
}
|
||||
|
||||
let gdt_ptr = ptr::with_exposed_provenance::<u64>(0xc000);
|
||||
let gdt_ptr = ptr::with_exposed_provenance::<u64>(0xe000);
|
||||
let gdt_slice = unsafe { slice::from_raw_parts(gdt_ptr, 4) };
|
||||
|
||||
vga_println!("hello from rust :)");
|
||||
|
||||
Reference in new issue
Block a user