[392] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
| 2 | ; Description : Int 19h Handler (Boot Loader).
|
---|
| 3 |
|
---|
| 4 | ;
|
---|
[526] | 5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
| 6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
[392] | 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.
|
---|
[526] | 12 | ;
|
---|
[392] | 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
|
---|
[526] | 16 | ; GNU General Public License for more details.
|
---|
[392] | 17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
[526] | 18 | ;
|
---|
[392] | 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:
|
---|
[595] | 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 |
|
---|
| 41 | xor ax, ax
|
---|
| 42 | mov ds, ax
|
---|
| 43 | %ifdef USE_386
|
---|
| 44 | mov fs, ax
|
---|
| 45 | mov gs, ax
|
---|
| 46 | %endif
|
---|
| 47 | cmp WORD [bx+510], 0AA55h ; Valid boot sector?
|
---|
| 48 | jne SHORT .Reboot
|
---|
| 49 | push es ; Zero
|
---|
| 50 | push bx
|
---|
| 51 | retf
|
---|
| 52 |
|
---|
| 53 | ; Do warm reset since boot from floppy drive failed
|
---|
| 54 | .Reboot:
|
---|
[392] | 55 | mov ax, BOOT_FLAG_WARM ; Skip memory tests
|
---|
| 56 | jmp Reboot_ComputerWithBootFlagInAX
|
---|