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/selector.s,v 1.2 2000/08/06 14:35:37 kato Exp $
29 # $DragonFly: src/sys/boot/pc98/boot0.5/Attic/selector.s,v 1.3 2003/11/10 06:08:38 dillon Exp $
36 # Display partition table.
39 # Clear partion table area
58 # XXX Move this to a suitable place!
65 # Check the number of partitions
70 # Just show the `no slice' message.
74 movw $msg_noslice, %di
78 xorw %si, %si # %si = partition number
80 push %cx # %cx = number of partitions
88 addw $0x10, %di # SYSM field
89 # SYSM: space filled string. Don't use sc_puts.
93 movb parttable(%di), %al
104 # Show default slice indicator
105 # If the default boot slice exists, `*' indicator will be showed.
107 showdefaultslicemark:
108 cmpb $0x80, defpartflag
126 cmpb partnum(%bx), %al
139 # Hide default slice indicator
141 hidedefaultslicemark:
152 loop hidedefslice_loop
156 # Toggle default slice
159 cmpb $0x80, defpartflag
163 call write_ipl # Restore
164 call hidedefaultslicemark
168 movw curpartition, %si
169 movb partnum(%si), %al # %al = real partition number
172 # Default slice must be bootable
173 testb $0x80, parttable(%si)
175 # Current partition is not bootable.
178 movb $0x80, defpartflag
180 call write_ipl # Restore
181 call showdefaultslicemark
211 movw curpartition, %dx
222 movw curpartition, %dx
242 movw $msg_forceclr, %di
254 # Main loop for device mode
258 call hidedefaultslicemark
260 call showdefaultslicemark
293 cmpb $0x3d, %ah # DOWN
295 cmpb $0x3c, %ah # RIGHT
297 cmpb $0x1c, %ah # RETURN
301 movw $3, mode # N88-BASIC
309 call hidedefaultslicemark
311 call showdefaultslicemark
320 call hidedefaultslicemark
322 call showdefaultslicemark
328 movw $1, mode # Slice mode
332 # main loop for slice mode
335 movw $0, curpartition
366 cmpb $0x3d, %ah # DOWN
368 cmpb $0x3b, %ah # LEFT
370 cmpb $0x00, %ah # ESC
372 cmpb $0x1c, %ah # RETURN
374 cmpb $0x34, %ah # SPC
380 cmpw $0, curpartition
387 movw curpartition, %bx
397 movw $0, mode # Device mode
404 movw curpartition, %si
407 testb $0x80, parttable(%si)
421 movw $0, curdevice # trydefault may change the curdevice.
439 curpartition: .word 0 # current patition
443 msg_slice: .asciz "Slice"
444 msg_noslice: .asciz "no slice"
445 msg_force: .asciz "This slice is not bootable. Continue? (Y / [N])"
446 msg_forceclr: .asciz " "