1 ; -----------------------------------------------------------------------
3 ; Copyright 1999-2008 H. Peter Anvin - All Rights Reserved
5 ; This program is free software; you can redistribute it and/or modify
6 ; it under the terms of the GNU General Public License as published by
7 ; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
8 ; Boston MA 02110-1301, USA; either version 2 of the License, or
9 ; (at your option) any later version; incorporated herein by reference.
11 ; -----------------------------------------------------------------------
16 ; Boot from a local disk, or invoke INT 18h.
20 ; Boot a specified local disk. AX specifies the BIOS disk number; or
21 ; -1 in case we should execute INT 18h ("next device.")
27 RESET_STACK_AND_SEGS dx ; dx <- 0
36 ; Load boot sector from the specified BIOS device and jump to it.
40 xor ax,ax ; Reset drive
42 mov ax,0201h ; Read one sector
43 mov cx,0001h ; C/H/S = 0/0/1 (first sector)
53 jmp kaboom ; Failure...
56 cli ; Abandon hope, ye who enter here
59 mov cx,512 ; Probably overkill, but should be safe
63 jmp 0:07C00h ; Jump to new boot sector
66 int 18h ; Hope this does the right thing...
67 jmp kaboom ; If we returned, oh boy...
70 localboot_msg db 'Booting from local disk...', CR, LF, 0