Added a global variable gBootDriveID where %dl is stored to.
Moved the data section closer to the end of the 1024 bytes of the boot block - the region before is reused as scratch buffer in the real mode data segment. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7245 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -61,6 +61,7 @@ bfs_start:
|
|||||||
movl %cr0, %eax // set the PE bit of cr0 to switch to protected mode
|
movl %cr0, %eax // set the PE bit of cr0 to switch to protected mode
|
||||||
orb $0x1, %al
|
orb $0x1, %al
|
||||||
movl %eax, %cr0
|
movl %eax, %cr0
|
||||||
|
|
||||||
.code32
|
.code32
|
||||||
.byte 0x66
|
.byte 0x66
|
||||||
ljmp $0x8, $_protected_code_segment
|
ljmp $0x8, $_protected_code_segment
|
||||||
@@ -75,6 +76,9 @@ _protected_code_segment:
|
|||||||
mov $0x10000, %ebp // setup new stack
|
mov $0x10000, %ebp // setup new stack
|
||||||
mov %ebp, %esp
|
mov %ebp, %esp
|
||||||
|
|
||||||
|
movw %dx, gBootDriveID
|
||||||
|
// save boot device
|
||||||
|
|
||||||
call _start
|
call _start
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
@@ -113,6 +117,11 @@ _a20_done:
|
|||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
|
.org 896
|
||||||
|
// since we don't need the above space when the boot loader is
|
||||||
|
// running, it is used as a real mode scratch buffer (as our
|
||||||
|
// boot loader spans over the whole real mode 0x1000 segment)
|
||||||
|
|
||||||
/* global data table */
|
/* global data table */
|
||||||
|
|
||||||
gdt:
|
gdt:
|
||||||
@@ -141,4 +150,8 @@ gdt_descriptor:
|
|||||||
.word 0x2f // 6 entries in the GDT (8 bytes each)
|
.word 0x2f // 6 entries in the GDT (8 bytes each)
|
||||||
.long gdt
|
.long gdt
|
||||||
|
|
||||||
|
.globl gBootDriveID
|
||||||
|
gBootDriveID:
|
||||||
|
.word 0
|
||||||
|
|
||||||
.org 1024
|
.org 1024
|
||||||
|
|||||||
Reference in New Issue
Block a user