Skip to content

Commit c197040

Browse files
committed
Introduce 32bit absolute DS GDT selector
1 parent accdbce commit c197040

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

include/fuzzy/memmgr/tables/gdt.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GDT_STD_SELECTOR_KERNEL_DS EQU 2
88
GDT_STD_SELECTOR_ABS16_CS EQU 3
99
GDT_STD_SELECTOR_ABS16_DS EQU 4
1010
GDT_STD_SELECTOR_ABS32_DS EQU 6
11-
GDT_STD_SIZE EQU 5 ; FIX
11+
GDT_STD_SIZE EQU 7
1212

1313
GDT_STD_SIZEOF_ENTRY EQU 8
1414
; END_ENSURE_SAME_gdt_h

include/fuzzy/memmgr/tables/gdt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define GDT_STD_SELECTOR_ABS16_CS 3
1111
#define GDT_STD_SELECTOR_ABS16_DS 4
1212
#define GDT_STD_SELECTOR_ABS32_DS 6
13-
#define GDT_STD_SIZE 5 // FIX
13+
#define GDT_STD_SIZE 7
1414
// Entries on and after GDT_STD_SIZE are reserved for applications
1515
// and are in CS, DS order for each app.
1616
// END_ENSURE_SAME_gdt_asm

src/drivers/display/text_mode_vga.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ global _low_flush
1616
; push edi
1717

1818
push ds
19-
mov eax, GDT_ABS16_DS
19+
mov eax, GDT_ABS32_DS
2020
mov ds, eax ; Absolute memory address
2121

2222
mov ebx,[ebp + 0x10] ; (ROW_WIDTH*y+x)
@@ -41,7 +41,7 @@ global _low_flush
4141
; push esi
4242
; push edi
4343
push ds
44-
mov eax, GDT_ABS16_DS
44+
mov eax, GDT_ABS32_DS
4545
mov ds, eax ; Absolute memory address
4646

4747
; Copy char+colors in Row Order Format
@@ -73,7 +73,7 @@ global _low_flush
7373
push esi
7474
push edi
7575
push es
76-
mov eax, GDT_ABS16_DS
76+
mov eax, GDT_ABS32_DS
7777
mov es, eax ; Absolute memory address
7878

7979
mov esi, [ebp + 0x8] ; (buffer)

src/memmgr/tables/gdt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ void populate_gdt_table(
7373
0x92);
7474
// NOT USING &gdt_table[5] for now.
7575
// Absolute Data Segment Selector
76-
// populate_gdt_entry(
77-
// &gdt_table[GDT_STD_SELECTOR_ABS32_DS],
78-
// 0, 0xffffffff,
79-
// 0b0100, // 32-bit protected mode
80-
// 0x92);
76+
populate_gdt_entry(
77+
&gdt_table[GDT_STD_SELECTOR_ABS32_DS],
78+
0, 0xffffffff,
79+
0b0100, // 32-bit protected mode
80+
0x92);
8181
// Ensure GDT_STD_SIZE = last sector entry+1
8282

8383
gdtr->base_address = ds_fix+(int)gdt_table;

0 commit comments

Comments
 (0)