source: trunk/TOOLS/DOS/INITHDD/INITHDD.ASM@ 30

Last change on this file since 30 was 30, checked in by Ben Rietbroek, 14 years ago

AiR-BOOT v1.07 -- As released with eCS v2.1. [2011-05-06]
Signature-date: 2006-03-13. (incorrect)
Trunk contains buildable v1.07 version as distributed with eCS v2.1.
Directory 'tags' contains v1.06 & v1.07 reference versions
built for all languages. Note that language ID for 'Dutch' changed
from 'DT' to 'NL' in v1.07 and that the v1.06 reference version also
uses 'NL' for 'Dutch'.
Also note that helper programs like the installer and setaboot are
are only modified for the OS/2 versions in v1.07.
The signature-date for v1.07 incorrectly states the same
date as for v1.06. The signature-version is correct.
Removed other binaries. (cd-rom images, old releases, etc.)
The tags serve as reference versions:

  • v1.06: rebuilt from source. (tags/v1.06r)
  • v1.07: built as released with eCS v2.1. (tags/v1.07r)
File size: 7.3 KB
Line 
1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
2;
3; This file is part of AiR-BOOT
4;
5; AiR-BOOT is free software: you can redistribute it and/or modify it under
6; the terms of the GNU General Public License as published by the Free
7; Software Foundation, either version 3 of the License, or (at your option)
8; any later version.
9;
10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
11; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
12; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13; details.
14;
15; You should have received a copy of the GNU General Public License along with
16; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
17;
18
19JUMPS
20
21Include ..\..\..\include\asm.inc
22;include ..\..\..\include\dos\airboot.inc
23
24 .386p
25 model large, basic
26
27code_seg segment public use16
28 assume cs:code_seg, ds:nothing, es:nothing, ss:nothing
29 org 100h
30air_boot_setup: jmp INITHDD_Start
31
32Introduction: db 'INITHDD - AiR-BOOT Initialize HDD Utility (DOS) - (c) 2004 by M. Kiewitz',13,10
33 db 0
34
35TXT_ERROR_IO db 'Could not access harddrive', 13, 10, 0
36TXT_ERROR_NotNeeded db 'INITHDD: Initialization not needed.', 13, 10, 0
37TXT_Done db 'INITHDD: HDD was successfully initialized.', 13, 10, 0
38TXT_Cleared db 'INITHDD: Reserved Sectors successfully cleared.', 13, 10, 0 ; Rousseau: added
39
40StandardMBR:
41 dw 02BFAh, 08EC0h, 0B8D0h, 07C00h, 0E08Bh, 0FCFBh, 0C02Bh, 0D88Eh, 000BEh
42 dw 0B87Ch, 00060h, 0C08Eh, 0FF2Bh, 000B9h, 0F301h, 0EAA5h, 00024h, 00060h
43 dw 0C88Ch, 0D88Eh, 004B9h, 0BF00h, 001BEh, 0158Bh, 0FA80h, 07480h, 0800Ch
44 dw 000FAh, 05075h, 0C783h, 0E210h, 0CDEFh, 08B18h, 0EBF7h, 0830Dh, 010C7h
45 dw 0058Bh, 0803Ch, 03C74h, 0003Ch, 03875h, 0F1E2h, 005B9h, 0B800h, 00000h
46 dw 0C08Eh, 000BBh, 0B47Ch, 0B002h, 05101h, 04C8Bh, 0CD02h, 05913h, 00B73h
47 dw 000B4h, 013CDh, 0E5E2h, 0C9BEh, 0EB00h, 02616h, 0BF81h, 001FEh, 0AA55h
48 dw 00575h, 000EAh, 0007Ch, 0BE00h, 000B5h, 003EBh, 09DBEh, 0AC00h, 0243Ch
49 dw 0FE74h, 0BB56h, 00007h, 00EB4h, 010CDh, 0EB5Eh, 049F0h, 0766Eh, 06C61h
50 dw 06469h, 07020h, 07261h, 06974h, 06974h, 06E6Fh, 07420h, 06261h, 0656Ch
51 dw 04E24h, 0206Fh, 0706Fh, 07265h, 07461h, 06E69h, 02067h, 07973h, 07473h
52 dw 06D65h, 04F24h, 06570h, 06172h, 06974h, 0676Eh, 07320h, 07379h, 06574h
53 dw 0206Dh, 06F6Ch, 06461h, 06520h, 07272h, 0726Fh, 00024h, 00000h, 00000h
54 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
55 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
56 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
57 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
58 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
59 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
60 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
61 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
62 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
63 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
64 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
65 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
66 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
67 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
68 dw 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h, 00000h
69 dw 00000h, 00000h, 00000h, 0AA55h
70
71; Include ..\..\..\include\DOS\Const.asm
72
73INITHDD_Start: mov ax, cs
74 mov ds, ax
75 mov es, ax ; DS==ES==CS
76 ; Show Introduction message
77 mov si, offset Introduction
78 call MBR_Teletype
79
80 mov ax, cs
81 mov es, ax
82 mov bx, offset CurMBR
83 mov dx, 0080h ; First harddrive, Sector 1
84 mov cx, 0001h
85 mov ax, 0201h ; Read 1 sector
86 int 13h
87 jnc Clear ; Rousseau: added (only clear)
88 jnc LoadMBR_NoError
89 mov si, offset TXT_ERROR_IO
90 call MBR_Teletype
91 jmp GoByeBye
92 LoadMBR_NoError:
93 ; Check Master-Boot-Record Signature
94 cmp wptr ds:[CurMBR+01FEh], 0AA55h
95 ;;je AlreadyInitialized ; Rousseau: always initialize
96
97 mov ax, cs
98 mov es, ax ; Make sure that ES is right
99 mov bx, offset StandardMBR
100 mov dx, 0080h ; First harddrive, Sector 1...
101 mov cx, 0001h
102 mov ax, 0301h ; Function 03, 1 sector to write
103 int 13h
104 jnc Done
105 mov si, offset TXT_ERROR_IO
106 call MBR_Teletype
107 jmp GoByeBye
108 Done:
109 mov si, offset TXT_Done
110 call MBR_Teletype
111
112 ; Rousseau: added
113 Clear:
114 call MBR_ClearReservedSectors
115 mov si, offset TXT_Cleared
116 call MBR_Teletype
117 ; Rousseau: end added
118
119 jmp GoByeBye
120
121 AlreadyInitialized:
122 mov si, offset TXT_Error_NotNeeded
123 call MBR_Teletype
124
125GoByeBye: mov ax, 4C00h
126 int 21h ; Terminate us...
127 ; End-Of-Code
128
129; In: SI - Pointer to begin of string (EOS is 0)
130; Destroyed: SI
131MBR_Teletype Proc Near Uses ax bx cx
132 mov ah, 0Eh
133 mov bx, 7
134 MBR_Teletype_Loop:
135 lodsb
136 or al, al
137 jz MBR_Teletype_End
138 int 10h
139 jmp MBR_Teletype_Loop
140 MBR_Teletype_End:
141 ret
142MBR_Teletype EndP
143
144
145; Rousseau: added
146MBR_ClearReservedSectors Proc Near
147 mov ax, cs
148 mov es, ax ; Make sure that ES is right
149 mov cx, 2 ; Index of first reserved sector to clear
150 MBR_ClearReservedSectors_loop:
151 push cx ; Put on stack for later use
152 mov bx, offset ZeroSEC ; Block of 0's
153 mov dx, 0080h ; First harddrive, Sector in cx
154 ;mov cx, 0001h
155 mov ax, 0301h ; Function 03, 1 sector to write
156 int 13h
157 pop cx ; Pop sector-index
158 inc cx ; Next sector
159 cmp cx, 62 ; If below 63 (Possible LVM) then...
160 jbe MBR_ClearReservedSectors_loop ; Repeat
161 ret
162MBR_ClearReservedSectors EndP
163
164
165
166CurMBR db 512 dup (?)
167ZeroSEC db 512 dup (0) ; Rousseau: added
168
169code_seg ends
170 end air_boot_setup
Note: See TracBrowser for help on using the repository browser.