-
Notifications
You must be signed in to change notification settings - Fork 4
Use a low address to store GDT and E820 #20
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ _lowlevel_init: | |
| nop; | ||
| nop; | ||
|
|
||
| #Get memory map and store memroy table start from 0x00098004, each entry has 20bytes data but | ||
| #Get memory map and store memroy table start from $INITSEG:1004, each entry has 20bytes data but | ||
| #currently we reserve 0x20 bytes for each entry | ||
| #Each entry has : | ||
| #First uint64_t = Base address | ||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment, move E820_OFFSET to common.h |
||
| mov $E820_OFFSET, %di | ||
| xor %ebx, %ebx | ||
| mov $0x0534D4150, %edx | ||
| mov $0xe820,%eax | ||
|
|
@@ -107,8 +108,6 @@ get_next: | |
| int $0x15 | ||
| cmp $0, %ebx /*ebx=0 means no other entry*/ | ||
| jnz get_next | ||
| #for debug | ||
| # hlt | ||
|
|
||
| #Inital Serial Device 1 | ||
| #com1 at 0x3F8 | ||
|
|
@@ -185,7 +184,7 @@ fin: | |
| hlt | ||
| jmp fin | ||
|
|
||
| INITSEG = 0x7000 | ||
| INITSEG = 0x0050 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
|
|
||
| idt_ptr: | ||
| .word 0 /* limit */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ extern struct bitmap_font font; | |
| unsigned int memtest(unsigned int start, unsigned int end); | ||
|
|
||
| #define SYSSEG 0x1000 | ||
| #define INITSEG 0x0050 | ||
| #define MEMMAN_ADDR (char *)((0x003c0000) - (SYSSEG << 4)) | ||
| #define VRAM_ADDR (unsigned char *)((0xa0000)-(SYSSEG << 4)) | ||
| #define COL8_000000 0 | ||
|
|
@@ -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)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
|
|
||
| struct SEGMENT_DESCRIPTOR { | ||
| short limit_low, base_low; | ||
|
|
||
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.