]>
Commit | Line | Data |
---|---|---|
14c7c974 A |
1 | ; bootnot.asm - boot1 written for turbo assembler, since gas only\r |
2 | ; generates 32 bit code and this must run in real mode. | |
3 | ; To compile as floppy boot1f.not: | |
4 | ; tasm /m3 /dBOOTDEV=FLOPPY boot1 ,boot1f | |
5 | ; tlink boot1f | |
6 | ; exe2bin boot1f | |
7 | ; ren boot1f.bin boot1f.not | |
8 | \r | |
9 | ;***********************************************************************\r | |
10 | ; This is the code for the NeXT boot1 bootsector. | |
11 | ;***********************************************************************\r | |
12 | \r | |
13 | P486 ;enable i386 instructions\r | |
14 | IDEAL\r | |
15 | SEGMENT CSEG\r | |
16 | ASSUME CS:CSEG,DS:CSEG\r | |
17 | \r | |
18 | SDEBUG = 0\r | |
19 | \r | |
20 | ;BOOTSEG = 100h ; boot will be loaded at 4k\r | |
21 | ;BOOTOFF = 0000h | |
22 | BOOTSEG = 00h | |
23 | BOOTOFF = 1000h | |
24 | BUFSZ = 2000h ; 8K disk transfer buffer\r | |
25 | \r\r | |
26 | ; This code is a replacement for boot1. It is loaded at 0x0:0x7c00\r | |
27 | \r | |
28 | start:\r | |
29 | mov ax,BOOTSEG | |
30 | cli ; interrupts off\r | |
31 | mov ss,ax ; set up stack seg\r | |
32 | mov sp,0fff0h\r | |
33 | sti ; reenable interrupts\r | |
34 | ||
35 | xor ax,ax | |
36 | mov es,ax | |
37 | mov ds,ax | |
38 | mov si,7C00h | |
39 | cld ; so pointers will get updated\r | |
40 | mov di,0E000h ; relocate boot program to 0xE000\r | |
41 | mov cx,100h ; copy 256x2 bytes\r | |
42 | repnz movsw ; move it\r | |
43 | off1 = 0E000h + (a1 - start)\r | |
44 | jmp FAR 0000:off1 ; jump to a1 in relocated place\r | |
45 | ||
46 | a1:\r | |
47 | mov ax,0E00h\r | |
48 | mov ds,ax\r | |
49 | mov ax,BOOTSEG\r | |
50 | mov es,ax\r | |
51 | ||
52 | mov si, OFFSET not_boot\r | |
53 | call message ; display intro message\r | |
54 | ||
55 | halt: | |
56 | mov ah, 00h | |
57 | int 16h | |
58 | jmp halt ; get key and loop forever | |
59 | \r | |
60 | message: ; write the error message in ds:esi | |
61 | ; to console\r | |
62 | push es\r | |
63 | mov ax,ds\r | |
64 | mov es,ax\r | |
65 | \r | |
66 | mov bx, 1 ; bh=0, bl=1 (blue)\r | |
67 | cld\r | |
68 | \r | |
69 | nextb:\r | |
70 | lodsb ; load a byte into al\r | |
71 | cmp al, 0\r | |
72 | je done\r | |
73 | mov ah, 0eh ; bios int 10, function 0xe\r | |
74 | int 10h ; bios display a byte in tty mode\r | |
75 | jmp nextb\r | |
76 | done: pop es\r | |
77 | ret\r | |
78 | \r | |
79 | putchr:\r | |
80 | push bx\r | |
81 | mov bx, 1 ; bh=0, bl=1 (blue)\r | |
82 | mov ah, 0eh ; bios int 10, function 0xe\r | |
83 | int 10h ; bios display a byte in tty mode\r | |
84 | pop bx\r | |
85 | ret\r | |
86 | \r\r | |
87 | \r | |
88 | not_boot: | |
89 | db 10,13 | |
90 | db 'The disk in the floppy disk drive isn''t a startup disk:' | |
91 | db 10,13 | |
92 | db 'It doesn''t contain ' | |
93 | db 'the system files required to start up the computer.' | |
94 | db 10,13 | |
95 | db 'Please eject this disk and restart the computer' | |
96 | db ' with a floppy disk,' | |
97 | db 10,13 | |
98 | db 'hard disk, or CD-ROM that is a startup disk.' | |
99 | db 10,13 | |
100 | db 0 | |
101 | ||
102 | ; the last 2 bytes in the sector contain the signature\r | |
103 | d1:\r | |
104 | a2 = 510 - (d1 - start)\r | |
105 | DB a2 dup (0)\r | |
106 | DW 0AA55h\r | |
107 | ENDS\r | |
108 | END\r |