1 | ; Project name : XTIDE Universal BIOS
|
---|
2 | ; Description : Int 19h Handler (Boot Loader).
|
---|
3 |
|
---|
4 | ;
|
---|
5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
7 | ;
|
---|
8 | ; This program is free software; you can redistribute it and/or modify
|
---|
9 | ; it under the terms of the GNU General Public License as published by
|
---|
10 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
11 | ; (at your option) any later version.
|
---|
12 | ;
|
---|
13 | ; This program is distributed in the hope that it will be useful,
|
---|
14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | ; GNU General Public License for more details.
|
---|
17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
18 | ;
|
---|
19 |
|
---|
20 | ; Section containing code
|
---|
21 | SECTION .text
|
---|
22 |
|
---|
23 | ;--------------------------------------------------------------------
|
---|
24 | ; INT 19h handler that properly reboots the computer when
|
---|
25 | ; INT 19h is called.
|
---|
26 | ;
|
---|
27 | ; Int19hReset_Handler
|
---|
28 | ; Parameters:
|
---|
29 | ; Nothing
|
---|
30 | ; Returns:
|
---|
31 | ; Never returns (reboots computer)
|
---|
32 | ;--------------------------------------------------------------------
|
---|
33 | Int19hReset_Handler:
|
---|
34 | ; Try to boot from drive A.
|
---|
35 | ; This is needed if INT 19h is used to launch booter games while
|
---|
36 | ; preserving interrupt vector table (for example to hook interrupt 10h)
|
---|
37 | xor dx, dx ; Drive 00h
|
---|
38 | call BootSector_LoadFirstSectorFromDriveDL
|
---|
39 | jc SHORT .Reboot
|
---|
40 | cmp WORD [bx+510], 0AA55h ; Valid boot sector?
|
---|
41 | je SHORT Int19h_JumpToBootSectorInESBXOrRomBootWithoutStackChange
|
---|
42 |
|
---|
43 | ; Do warm reset since boot from floppy drive failed
|
---|
44 | .Reboot:
|
---|
45 | mov ax, BOOT_FLAG_WARM ; Skip memory tests
|
---|
46 | jmp Reboot_ComputerWithBootFlagInAX
|
---|