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.
35 # Display partition table.
38 # Clear partition table area
57 # XXX Move this to a suitable place!
64 # Check the number of partitions
69 # Just show the `no slice' message.
73 movw $msg_noslice, %di
77 xorw %si, %si # %si = partition number
79 push %cx # %cx = number of partitions
87 addw $0x10, %di # SYSM field
88 # SYSM: space filled string. Don't use sc_puts.
92 movb parttable(%di), %al
103 # Show default slice indicator
104 # If the default boot slice exists, `*' indicator will be showed.
106 showdefaultslicemark:
107 cmpb $0x80, defpartflag
125 cmpb partnum(%bx), %al
138 # Hide default slice indicator
140 hidedefaultslicemark:
151 loop hidedefslice_loop
155 # Toggle default slice
158 cmpb $0x80, defpartflag
162 call write_ipl # Restore
163 call hidedefaultslicemark
167 movw curpartition, %si
168 movb partnum(%si), %al # %al = real partition number
171 # Default slice must be bootable
172 testb $0x80, parttable(%si)
174 # Current partition is not bootable.
177 movb $0x80, defpartflag
179 call write_ipl # Restore
180 call showdefaultslicemark
210 movw curpartition, %dx
221 movw curpartition, %dx
241 movw $msg_forceclr, %di
253 # Main loop for device mode
257 call hidedefaultslicemark
259 call showdefaultslicemark
292 cmpb $0x3d, %ah # DOWN
294 cmpb $0x3c, %ah # RIGHT
296 cmpb $0x1c, %ah # RETURN
300 movw $3, mode # N88-BASIC
305 ret # Dummy ret @0x9ab
313 call hidedefaultslicemark
315 call showdefaultslicemark
324 call hidedefaultslicemark
326 call showdefaultslicemark
332 movw $1, mode # Slice mode
336 # main loop for slice mode
339 movw $0, curpartition
370 cmpb $0x3d, %ah # DOWN
372 cmpb $0x3b, %ah # LEFT
374 cmpb $0x00, %ah # ESC
376 cmpb $0x1c, %ah # RETURN
378 cmpb $0x34, %ah # SPC
384 cmpw $0, curpartition
391 movw curpartition, %bx
401 movw $0, mode # Device mode
408 movw curpartition, %si
411 testb $0x80, parttable(%si)
425 movw $0, curdevice # trydefault may change the curdevice.
443 curpartition: .word 0 # current patition
447 msg_slice: .asciz "Slice"
448 msg_noslice: .asciz "no slice"
449 msg_force: .asciz "This slice is not bootable. Continue? (Y / [N])"
450 msg_forceclr: .asciz " "