1 ; Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
3 ; @APPLE_LICENSE_HEADER_START@
5 ; Portions Copyright (c) 2002 Apple Computer, Inc. All Rights
6 ; Reserved. This file contains Original Code and/or Modifications of
7 ; Original Code as defined in and that are subject to the Apple Public
8 ; Source License Version 1.2 (the "License"). You may not use this file
9 ; except in compliance with the License. Please obtain a copy of the
10 ; License at http://www.apple.com/publicsource and read it before using
13 ; The Original Code and all software distributed under the License are
14 ; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 ; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 ; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 ; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
18 ; License for the specific language governing rights and limitations
21 ; @APPLE_LICENSE_HEADER_END@
35 times 8-($-$$) nop ; Ensure table is at offset 8
37 ; El Torito boot information table, filled in by the
38 ; mkisofs -boot-info-table option
39 bi_pvd: dd 0 ; LBA of primary volume descriptor
40 bi_file: dd 0 ; LBA of boot file
41 bi_length: dd 0 ; Length of boot file
42 bi_csum: dd 0 ; Checksum of boot file
43 bi_reserved: times 10 dd 0 ; Reserved
60 mov si, drive_str ; print drive number
67 test1: ; Test 1: El Torito status call
73 ;; dl already contains drive number
77 jnc test1a ; CF clear?
80 mov si, test1_fail1_str
85 cmp [spec.drive], dl ; drive in spec packet matches?
92 mov si, test1_fail2_str
100 test2: ; Check for EBIOS support
110 jnc test2a ; CF clear?
113 mov si, test2_fail1_str
122 mov si, test2_fail2_str
127 mov si, test2_vers_str ; print EDD version
132 mov si, test2_flag_str ; print EDD flags
139 and cl, 0x01 ; EDD drive access?
143 mov si, test2_fail3_str
155 test3: ; Disk geometry
167 mov si, test3_fail1_str
172 cmp word [disk_params.nbps], 0x0800
176 mov al, [disk_params.nbps+1]
178 mov al, [disk_params.nbps]
182 mov si, test3_fail2_str
204 ;; ----- Helper functions -----
216 ;; returns character in AL
221 ;--------------------------------------------------------------------------
222 ; Write the byte value to the console in hex.
225 ; AL = Value to be displayed in hex.
230 call print_nibble ; display upper nibble
232 call print_nibble ; display lower nibble
240 add al, 'A' - '9' - 1
245 ;--------------------------------------------------------------------------
246 ; Write a string to the console.
249 ; DS:SI pointer to a NULL terminated string.
256 mov bx, 1 ; BH=0, BL=1 (blue)
258 lodsb ; load a byte from DS:SI into AL
259 cmp al, 0 ; Is it a NULL?
260 je .exit ; yes, all done
261 mov ah, 0xE ; INT10 Func 0xE
262 int 0x10 ; display byte in tty mode
273 header_str: db "BIOS test v0.3", 10,13, 0
274 finished_str: db "Tests completed.", 10,13,0
275 drive_str: db "Boot drive: ", 0
276 pass_str: db "pass", 0
277 fail_str: db "FAIL", 0
278 crnl_str: db 10,13, 0
279 test1_str: db "Test 1: El Torito status: ", 0
280 test1_fail1_str: db "FAIL (CF=1)", 0
281 test1_fail2_str: db "FAIL (spec drive)", 0
282 test2_str: db "Test 2: EBIOS check: ", 0
283 test2_vers_str: db "vers. ", 0
284 test2_flag_str: db " flags ", 0
285 test2_fail1_str: db "FAIL (CF=1)", 0
286 test2_fail2_str: db "FAIL (BX != AA55)", 0
287 test2_fail3_str: db "FAIL (CL & 1 == 0)", 0
288 test3_str: db "Test 3: Geometry check: ", 0
289 test3_fail1_str: db "FAIL (CF=1)", 0
290 test3_fail2_str: db "FAIL (nbps != 0x200)", 0
296 ;; El Torito spec packet
311 ;; Disk parameter packet
323 .ignored: times 34 db 0