From 6ed14d8c59b937aa8f454defa778f141770ac8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 19 Apr 2004 22:36:13 +0000 Subject: [PATCH] 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 --- src/kernel/boot/platform/bios_ia32/shell.S | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/kernel/boot/platform/bios_ia32/shell.S b/src/kernel/boot/platform/bios_ia32/shell.S index b8885b7898..d241995a85 100644 --- a/src/kernel/boot/platform/bios_ia32/shell.S +++ b/src/kernel/boot/platform/bios_ia32/shell.S @@ -61,6 +61,7 @@ bfs_start: movl %cr0, %eax // set the PE bit of cr0 to switch to protected mode orb $0x1, %al movl %eax, %cr0 + .code32 .byte 0x66 ljmp $0x8, $_protected_code_segment @@ -75,6 +76,9 @@ _protected_code_segment: mov $0x10000, %ebp // setup new stack mov %ebp, %esp + movw %dx, gBootDriveID + // save boot device + 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 */ gdt: @@ -141,4 +150,8 @@ gdt_descriptor: .word 0x2f // 6 entries in the GDT (8 bytes each) .long gdt +.globl gBootDriveID +gBootDriveID: + .word 0 + .org 1024