Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wjn740
Copy link
Contributor

@wjn740 wjn740 commented Feb 12, 2020

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

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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))
Copy link
Contributor

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?

@coolgw
Copy link
Contributor

coolgw commented Feb 13, 2020

I have no idea the point of move this to the lower memory, could you help explain it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants