-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a low address to store GDT and E820 #20
base: master
Are you sure you want to change the base?
Use a low address to store GDT and E820 #20
Conversation
I move INITSEG to 0x0050. it is the lowest address for useable. this area about 30KB. it is enough to store GDT and E820.
@@ -3,7 +3,7 @@ | |||
|
|||
CYLS = 10 | |||
BOOTSEG = 0x07C0 | |||
INITSEG = 0x7000 | |||
INITSEG = 0x0050 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use #include <common.h> and remove INITSEG here.
BTW: the file name bootsector.s to bootsector.S.
@@ -93,7 +93,8 @@ _lowlevel_init: | |||
# Type 4: ACPI NVS memory | |||
# Type 5: Area containing bad memory | |||
#Set register base https://wiki.osdev.org/Detecting_Memory_(x86) | |||
mov $0x8004, %di | |||
E820_OFFSET=0x1004 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment, move E820_OFFSET to common.h
@@ -185,7 +184,7 @@ fin: | |||
hlt | |||
jmp fin | |||
|
|||
INITSEG = 0x7000 | |||
INITSEG = 0x0050 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -43,7 +44,8 @@ unsigned int memtest(unsigned int start, unsigned int end); | |||
#define COL8_840084 13 | |||
#define COL8_008484 14 | |||
#define COL8_848484 15 | |||
#define MEM_MAP_ADDR (char *)((0x00078004)-(SYSSEG << 4)) | |||
#define E820_OFFSET 0x1004 | |||
#define MEM_MAP_ADDR (char *)((INITSEG << 4)+(E820_OFFSET)-(SYSSEG << 4)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is the address after paging? so this PR depend on the paging PR?
I have no idea the point of move this to the lower memory, could you help explain it? |
I move INITSEG to 0x0050. it is the lowest address for useable.
this area about 30KB. it is enough to store GDT and E820.
https://wiki.osdev.org/Memory_Map_(x86)#Overview