1 # Copyright (c) KATO Takenori, 1999, 2000.
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.
28 # $FreeBSD: src/sys/boot/pc98/boot0.5/boot0.5.s,v 1.2 2000/08/06 14:35:37 kato Exp $
29 # $DragonFly: src/sys/boot/pc98/boot0.5/Attic/boot0.5.s,v 1.3 2003/11/10 06:08:38 dillon Exp $
37 movw $0x501, %bx # BIOS_FLAG
45 # Display title and copyright.
55 xorw %si, %si # number of partition
56 call scan_sasi # SASI/IDE
61 jmp exit # No hard drives
64 # Setup sector size depended parameters
65 movw %si, %cx # %cx = number of devices
70 movw secsize(%di), %ax
76 movw $0x100, partoff(%di)
77 movw $0x0fa, defflagoff(%di)
78 movw $0x0fb, defpartoff(%di)
84 movw $0x400, partoff(%di)
85 movw $0x3fa, defflagoff(%di)
86 movw $0x3fb, defpartoff(%di)
87 movb $32, maxpart(%di)
91 movw $0x200, partoff(%di)
92 movw $0x1fa, defflagoff(%di)
93 movw $0x1fb, defpartoff(%di)
94 movb $16, maxpart(%di)
98 # For debug with floppy, fake the parameter.
99 movw $0x584, %bx # DISK_BOOT
113 # If the TAB is pressed, don't try to boot from default partition
118 jz key_release # KBD buffer empty.
120 cmpb $0x0f, %ah # TAB
127 jnz dont_try_default # TAB pressed.
129 # Default partition not found.
143 movw $msg_usage1, %di
148 movw $msg_usage2, %di
153 movw $msg_usage3, %di
158 movw $msg_usage4, %di
163 movw $msg_usage5, %di
168 movw $msg_usage6, %di
173 movw $msg_usage7, %di
178 movw $msg_usage8, %di
183 movw $msg_usage9, %di
188 movw $msg_usage10, %di
193 movw $msg_usage11, %di
198 movw $msg_usage12, %di
203 # Display device list
209 movw $msg_device, %di
211 xorw %si, %si # %si = device number
212 movw ndevice, %cx # %cx = number of devices
228 movw $msg_unknown, %di
240 # Display unit number.
253 movw $msg_exitmenu, %di
258 .global curdevice, daua, secsize, defflagoff, defpartoff
259 .global maxpart, partoff, ndevice
260 ndevice: .word 0 # number of device
261 curdevice: .word 0 # current device
262 daua: .space 12 # DA/DU list
263 secsize: .space 12 * 2 # Sector soize
264 defflagoff: .space 12 * 2
265 defpartoff: .space 12 * 2
266 maxpart: .space 12 * 2
267 partoff: .space 12 * 2
272 title: .asciz "PC98 Boot Selector Version 1.1"
273 copyright: .ascii "(C)Copyright 1999, 2000 KATO Takenori. "
274 .asciz "All rights reserved."
275 msg_device: .asciz "Device"
276 msg_sasi: .asciz "SASI/IDE unit "
277 msg_scsi: .asciz "SCSI ID "
278 msg_unknown: .asciz "unknown unit "
279 msg_exitmenu: .asciz "Exit this menu"
280 msg_usage1: .asciz "Device list"
281 msg_usage2: .asciz "UP, DOWN: select boot device"
282 msg_usage3: .asciz "RETURN: move to slice list"
283 msg_usage4: .asciz "Slice list"
284 msg_usage5: .asciz "UP, DOWN: select boot slice"
285 msg_usage6: .asciz "RETURN: boot"
286 msg_usage7: .asciz "SPACE: toggle default"
287 msg_usage8: .asciz "ESC: move to device list"
288 msg_usage9: .asciz "LEGEND"
289 msg_usage10: .asciz ">>: selected device/slice"
290 msg_usage11: .asciz "*: default slice to boot"
291 msg_usage12: .asciz "!: unbootable slice"