1 # Copyright (c) KATO Takenori, 1999, 2000, 2007.
3 # All rights reserved. Unpublished rights reserved under the copyright
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # 1. Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer as
12 # the first lines of this file unmodified.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 movw $0x501, %bx # BIOS_FLAG
44 # Display title and copyright.
54 xorw %si, %si # number of partition
55 call scan_sasi # SASI/IDE
60 jmp exit # No hard drives
63 # Setup sector size dependent parameters
64 movw %si, %cx # %cx = number of devices
69 movw secsize(%di), %ax
75 movw $0x100, partoff(%di)
76 movw $0x0fa, defflagoff(%di)
77 movw $0x0fb, defpartoff(%di)
83 movw $0x400, partoff(%di)
84 movw $0x3fa, defflagoff(%di)
85 movw $0x3fb, defpartoff(%di)
86 movb $32, maxpart(%di)
90 movw $0x200, partoff(%di)
91 movw $0x1fa, defflagoff(%di)
92 movw $0x1fb, defpartoff(%di)
93 movb $16, maxpart(%di)
97 # For debug with floppy, fake the parameter.
98 movw $0x584, %bx # DISK_BOOT
112 # If the TAB is pressed, don't try to boot from default partition
117 jz key_release # KBD buffer empty.
119 cmpb $0x0f, %ah # TAB
126 jnz dont_try_default # TAB pressed.
128 # Default partition not found.
142 movw $msg_usage1, %di
147 movw $msg_usage2, %di
152 movw $msg_usage3, %di
157 movw $msg_usage4, %di
162 movw $msg_usage5, %di
167 movw $msg_usage6, %di
172 movw $msg_usage7, %di
177 movw $msg_usage8, %di
182 movw $msg_usage9, %di
187 movw $msg_usage10, %di
192 movw $msg_usage11, %di
197 movw $msg_usage12, %di
202 # Display device list
208 movw $msg_device, %di
210 xorw %si, %si # %si = device number
211 movw ndevice, %cx # %cx = number of devices
227 movw $msg_unknown, %di
239 # Display unit number.
252 movw $msg_exitmenu, %di
257 .global curdevice, ndevice
258 ndevice: .word 0 # number of device
259 curdevice: .word 0 # current device
264 title: .asciz "PC98 Boot Selector Version 1.2"
265 copyright: .ascii "(C)Copyright 1999-2007 KATO Takenori. "
266 .asciz "All rights reserved."
267 msg_device: .asciz "Device"
268 msg_sasi: .asciz "SASI/IDE unit "
269 msg_scsi: .asciz "SCSI ID "
270 msg_unknown: .asciz "unknown unit "
271 msg_exitmenu: .asciz "Exit this menu"
272 msg_usage1: .asciz "Device list"
273 msg_usage2: .asciz "UP, DOWN: select boot device"
274 msg_usage3: .asciz "RETURN: move to slice list"
275 msg_usage4: .asciz "Slice list"
276 msg_usage5: .asciz "UP, DOWN: select boot slice"
277 msg_usage6: .asciz "RETURN: boot"
278 msg_usage7: .asciz "SPACE: toggle default"
279 msg_usage8: .asciz "ESC: move to device list"
280 msg_usage9: .asciz "LEGEND"
281 msg_usage10: .asciz ">>: selected device/slice"
282 msg_usage11: .asciz "*: default slice to boot"
283 msg_usage12: .asciz "!: unbootable slice"
286 .global daua, secsize, defflagoff, defpartoff
287 .global maxpart, partoff
288 daua: .space 12 # DA/DU list
289 secsize: .space 12 * 2 # Sector soize
290 defflagoff: .space 12 * 2
291 defpartoff: .space 12 * 2
292 maxpart: .space 12 * 2
293 partoff: .space 12 * 2