1 ; Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 ; @APPLE_LICENSE_HEADER_START@
5 ; Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 ; This file contains Original Code and/or Modifications of Original Code
8 ; as defined in and that are subject to the Apple Public Source License
9 ; Version 2.0 (the 'License'). You may not use this file except in
10 ; compliance with the License. Please obtain a copy of the License at
11 ; http://www.opensource.apple.com/apsl/ and read it before using this
14 ; The Original Code and all software distributed under the License are
15 ; distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 ; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 ; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 ; FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
19 ; Please see the License for the specific language governing rights and
20 ; limitations under the License.
22 ; @APPLE_LICENSE_HEADER_END@
24 ; nullboot.s - boot1 written for nasm assembler, since gas only
25 ; generates 32 bit code and this must run in real mode.
26 ; To compile as floppy boot1f.not:
27 ; nasm -dBOOTDEV=FLOPPY nullboot1.s -o nullboot1
29 ;***********************************************************************
30 ; This is the code for the NeXT boot1 bootsector.
31 ;***********************************************************************
39 BUFSZ EQU 2000h ; 8K disk transfer buffer
41 ; This code is a replacement for boot1. It is loaded at 0x0:0x7c00
46 mov ss,ax ; set up stack seg
48 sti ; reenable interrupts
54 cld ; so pointers will get updated
55 mov di,0E000h ; relocate boot program to 0xE000
56 mov cx,100h ; copy 256x2 bytes
58 jmp 0000:0E000h + (a1 - start) ; jump to a1 in relocated place
67 call message ; display intro message
72 jmp short halt ; get key and loop forever
74 message: ; write the error message in ds:esi
80 mov bx, 1 ; bh=0, bl=1 (blue)
84 lodsb ; load a byte into al
87 mov ah, 0eh ; bios int 10, function 0xe
88 int 10h ; bios display a byte in tty mode
95 mov bx, 1 ; bh=0, bl=1 (blue)
96 mov ah, 0eh ; bios int 10, function 0xe
97 int 10h ; bios display a byte in tty mode
104 db 'The disk in the floppy disk drive isn',39,'t a startup disk:'
106 db 'It doesn',39,'t contain ' ; 39 = a ' char
107 db 'the system files required to start up the computer.'
109 db 'Please eject this disk and restart the computer'
110 db ' with a floppy disk,'
112 db 'hard disk, or CD-ROM that is a startup disk.'
116 ; the last 2 bytes in the sector contain the signature
118 a2 equ 510 - (d1 - start)
119 times a2 db 0 ; fill the rest with zeros