Rev 838 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 838 | Rev 848 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | ;; KolibriOS 16-bit loader, ;; |
9 | ;; KolibriOS 16-bit loader, ;; |
10 | ;; based on bootcode for MenuetOS ;; |
10 | ;; based on bootcode for MenuetOS ;; |
11 | ;; ;; |
11 | ;; ;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 13... | Line 13... | ||
13 | 13 | ||
Line 14... | Line 14... | ||
14 | $Revision: 838 $ |
14 | $Revision: 848 $ |
15 | 15 | ||
16 | 16 | ||
17 | ;========================================================================== |
17 | ;========================================================================== |
18 | ; |
18 | ; |
Line -... | Line 19... | ||
- | 19 | ; 16 BIT FUNCTIONS |
|
Line 19... | Line 20... | ||
19 | ; 16 BIT FUNCTIONS |
20 | ; |
20 | ; |
21 | ;========================================================================== |
21 | ;========================================================================== |
22 | |
22 | 23 | use16 |
|
Line 122... | Line 123... | ||
122 | mov ch,al ; ch=track number |
123 | mov ch,al ; ch=track number |
123 | xchg dh,dl ; dh=head number |
124 | xchg dh,dl ; dh=head number |
124 | mov dl,0 ; dl=0 (drive 0 (a:)) |
125 | mov dl,0 ; dl=0 (drive 0 (a:)) |
125 | pop bx |
126 | pop bx |
126 | retn |
127 | retn |
- | 128 | ||
- | 129 | sayerr: |
|
- | 130 | call print |
|
- | 131 | jmp $ |
|
- | 132 | ||
127 | ; needed variables |
133 | ; needed variables |
128 | BPB_SecPerTrk dw 0 ; sectors per track |
134 | BPB_SecPerTrk dw 0 ; sectors per track |
129 | BPB_NumHeads dw 0 ; number of heads |
135 | BPB_NumHeads dw 0 ; number of heads |
130 | BPB_FATSz16 dw 0 ; size of FAT |
136 | BPB_FATSz16 dw 0 ; size of FAT |
131 | BPB_RootEntCnt dw 0 ; count of root dir. entries |
137 | BPB_RootEntCnt dw 0 ; count of root dir. entries |
Line 145... | Line 151... | ||
145 | ;========================================================================= |
151 | ;========================================================================= |
Line 146... | Line 152... | ||
146 | 152 | ||
Line 147... | Line 153... | ||
147 | include 'bootvesa.inc' ;Include source for boot vesa |
153 | include 'bootvesa.inc' ;Include source for boot vesa |
- | 154 | ||
148 | 155 | start_of_code: |
|
149 | start_of_code: |
- | |
150 | cld |
- | |
151 | ; \begin{diamond}[02.12.2005] |
- | |
152 | ; if bootloader sets ax = 'KL', then ds:si points to loader block |
- | |
153 | cmp ax, 'KL' |
- | |
154 | jnz @f |
- | |
155 | mov word [cs:cfgmanager.loader_block], si |
- | |
156 | mov word [cs:cfgmanager.loader_block+2], ds |
- | |
Line 157... | Line -... | ||
157 | @@: |
- | |
158 | ; \end{diamond}[02.12.2005] |
156 | |
159 | 157 | cld |
|
160 | ; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source hard disk |
158 | |
161 | ; (see comment to bx_from_load) |
159 | xor ecx, ecx |
162 | cmp cx, 'HA' |
160 | xor edx, edx |
163 | jnz no_hd_load |
- | |
164 | cmp dx,'RD' |
- | |
Line 165... | Line -... | ||
165 | jnz no_hd_load |
- | |
166 | mov word [cs:bx_from_load], bx ; {SPraid}[13.03.2007] |
161 | xor esi, esi |
167 | no_hd_load: |
162 | xor edi, edi |
168 | 163 | xor ebp, ebp |
|
169 | ; set up stack |
- | |
- | 164 | ||
170 | mov ax, 3000h |
165 | mov eax, 0x3000 |
171 | mov ss, ax |
166 | mov ss, ax |
172 | mov sp, 0EC00h |
- | |
173 | ; set up segment registers |
167 | mov esp, 0EC00h |
Line 174... | Line 168... | ||
174 | push cs |
168 | |
175 | pop ds |
169 | mov ebx, 0x1000 |
176 | push cs |
170 | mov ds, bx |
Line 216... | Line 210... | ||
216 | mov cx, d80x25_top_num * 80 |
210 | mov cx, d80x25_top_num * 80 |
217 | @@: |
211 | @@: |
218 | lodsb |
212 | lodsb |
219 | stosw |
213 | stosw |
220 | loop @b |
214 | loop @b |
- | 215 | ||
221 | ; draw spaces |
216 | ; draw spaces |
222 | mov si, space_msg |
217 | mov si, space_msg |
223 | mov dx, 25 - d80x25_top_num - d80x25_bottom_num |
218 | mov dx, 25 - d80x25_top_num - d80x25_bottom_num |
224 | dfl1: |
219 | dfl1: |
225 | push si |
220 | push si |
Line 241... | Line 236... | ||
241 | 236 | ||
Line 242... | Line 237... | ||
242 | mov byte [space_msg+80], 0 ; now space_msg is null terminated |
237 | mov byte [space_msg+80], 0 ; now space_msg is null terminated |
Line 243... | Line -... | ||
243 | - | ||
244 | _setcursor d80x25_top_num,0 |
- | |
245 | - | ||
246 | - | ||
247 | ; TEST FOR 386+ |
- | |
248 | - | ||
249 | mov bx, 0x4000 |
- | |
250 | pushf |
- | |
251 | pop ax |
- | |
252 | mov dx, ax |
- | |
253 | xor ax, bx |
- | |
254 | push ax |
- | |
255 | popf |
- | |
256 | pushf |
- | |
257 | pop ax |
- | |
258 | and ax, bx |
- | |
259 | and dx, bx |
- | |
260 | cmp ax, dx |
- | |
261 | - | ||
262 | mov si, not386 |
- | |
263 | jz sayerr |
- | |
264 | - | ||
265 | xor eax, eax |
- | |
266 | cpuid |
- | |
267 | cmp eax, 0 |
- | |
268 | mov si, sz_nopse |
- | |
269 | jbe sayerr |
- | |
270 | - | ||
271 | mov eax, 1 |
- | |
272 | cpuid |
- | |
273 | bt edx, 3 |
- | |
274 | mov si, sz_nopse |
- | |
275 | jnc sayerr |
- | |
276 | - | ||
277 | xor ebx, ebx |
- | |
278 | mov es, bx |
- | |
279 | - | ||
280 | mov edi, 0x9104 |
- | |
281 | mov ecx, 20 |
- | |
282 | mov edx, 0x534D4150 |
- | |
283 | - | ||
284 | mov [es:0x9100], ebx |
- | |
285 | mov eax, 0xe820 |
- | |
286 | int 0x15 |
- | |
287 | mov si, sz_nosmap |
- | |
288 | jc sayerr |
- | |
289 | - | ||
290 | cmp eax, 0x534D4150 |
- | |
291 | je cpugood |
- | |
292 | sayerr: |
- | |
293 | call print |
- | |
294 | jmp $ |
- | |
295 | - | ||
296 | 238 | ||
297 | cpugood: |
239 | _setcursor d80x25_top_num,0 |
298 | 240 | ||
Line 299... | Line -... | ||
299 | push 0 |
- | |
300 | popf |
- | |
301 | sti |
- | |
302 | 241 | push 0 |
|
303 | ; set up esp |
242 | popf |
304 | movzx esp, sp |
243 | sti |
305 | 244 | ||
306 | push 0 |
245 | push 0 |
Line 407... | Line 346... | ||
407 | mov [es:0x9054], dx |
346 | mov [es:0x9054], dx |
Line 408... | Line 347... | ||
408 | 347 | ||
409 | apm_end: |
348 | apm_end: |
Line 410... | Line -... | ||
410 | _setcursor d80x25_top_num, 0 |
- | |
411 | - | ||
412 | ;CHECK current of code |
- | |
413 | cmp [cfgmanager.loader_block], -1 |
- | |
414 | jz noloaderblock |
- | |
415 | les bx, [cfgmanager.loader_block] |
- | |
416 | cmp byte [es:bx], 1 |
- | |
417 | mov si, loader_block_error |
349 | _setcursor d80x25_top_num, 0 |
418 | jnz sayerr |
350 | |
Line 419... | Line 351... | ||
419 | push 0 |
351 | push 0 |
420 | pop es |
352 | pop es |
421 | 353 | ||
422 | noloaderblock: |
354 | noloaderblock: |
423 | ; DISPLAY VESA INFORMATION |
355 | ; DISPLAY VESA INFORMATION |
Line 424... | Line -... | ||
424 | call print_vesa_info |
- | |
425 | call calc_vmodes_table |
356 | call print_vesa_info |
426 | call check_first_parm ;check and enable cursor_pos |
357 | call calc_vmodes_table |
427 | 358 | call check_first_parm ;check and enable cursor_pos |
|
428 | 359 | ||
429 | ; \begin{diamond}[30.11.2005] |
360 | ; \begin{diamond}[30.11.2005] |
Line 827... | Line 758... | ||
827 | ; DMA ACCESS TO HD |
758 | ; DMA ACCESS TO HD |
Line 828... | Line 759... | ||
828 | 759 | ||
829 | mov al, [preboot_dma] |
760 | mov al, [preboot_dma] |
Line 830... | Line -... | ||
830 | mov [es:0x901F], al |
- | |
831 | - | ||
832 | ; VRR_M USE |
- | |
833 | - | ||
834 | mov al,[preboot_vrrm] |
- | |
835 | mov [es:0x9030], al |
- | |
836 | mov [es:0x901E], byte 1 |
- | |
837 | - | ||
838 | ; BOOT DEVICE |
- | |
839 | - | ||
840 | mov al, [preboot_device] |
- | |
841 | dec al |
- | |
842 | mov [boot_dev], al |
- | |
843 | - | ||
844 | ; READ DISKETTE TO MEMORY |
- | |
845 | - | ||
846 | ; cmp [boot_dev],0 |
- | |
847 | jne no_sys_on_floppy |
- | |
848 | mov si,diskload |
- | |
849 | call print |
- | |
850 | xor ax, ax ; reset drive |
- | |
851 | xor dx, dx |
- | |
852 | int 0x13 |
- | |
853 | ; do we boot from CD-ROM? |
- | |
854 | mov ah, 41h |
- | |
855 | mov bx, 55AAh |
- | |
856 | xor dx, dx |
- | |
857 | int 0x13 |
- | |
858 | jc .nocd |
- | |
859 | cmp bx, 0AA55h |
- | |
860 | jnz .nocd |
- | |
861 | mov ah, 48h |
- | |
862 | push ds |
- | |
863 | push es |
- | |
864 | pop ds |
- | |
865 | mov si, 0xa000 |
- | |
866 | mov word [si], 30 |
- | |
867 | int 0x13 |
- | |
868 | pop ds |
- | |
869 | jc .nocd |
- | |
870 | push ds |
- | |
871 | lds si, [es:si+26] |
- | |
872 | test byte [ds:si+10], 40h |
- | |
873 | pop ds |
- | |
874 | jz .nocd |
- | |
875 | ; yes - read all floppy by 18 sectors |
- | |
876 | - | ||
877 | ; TODO: !!!! read only first sector and set variables !!!!! |
- | |
878 | ; ... |
- | |
879 | ; TODO: !!! then read flippy image track by track |
- | |
880 | - | ||
881 | mov cx, 0x0001 ; startcyl,startsector |
- | |
882 | .a1: |
- | |
883 | push cx dx |
- | |
884 | mov al, 18 |
- | |
885 | mov bx, 0xa000 |
- | |
886 | call boot_read_floppy |
- | |
887 | mov si, movedesc |
- | |
888 | push es |
- | |
889 | push ds |
- | |
890 | pop es |
- | |
891 | mov cx, 256*18 |
- | |
892 | mov ah, 0x87 |
- | |
893 | int 0x15 |
- | |
894 | pop es |
- | |
895 | pop dx cx |
- | |
896 | test ah, ah |
- | |
897 | jnz sayerr_floppy |
- | |
898 | add dword [si+8*3+2], 512*18 |
- | |
899 | inc dh |
- | |
900 | cmp dh, 2 |
- | |
901 | jnz .a1 |
- | |
902 | mov dh, 0 |
- | |
903 | inc ch |
- | |
904 | cmp ch, 80 |
- | |
905 | jae ok_sys_on_floppy |
- | |
906 | pusha |
- | |
907 | mov al, ch |
- | |
908 | shr ch, 2 |
- | |
909 | add al, ch |
- | |
910 | aam |
- | |
911 | xchg al, ah |
- | |
912 | add ax, '00' |
- | |
913 | mov si, pros |
- | |
914 | mov [si], ax |
- | |
915 | call printplain |
- | |
916 | popa |
- | |
917 | jmp .a1 |
- | |
918 | .nocd: |
- | |
919 | ; no - read only used sectors from floppy |
- | |
920 | ; now load floppy image to memory |
- | |
921 | ; at first load boot sector and first FAT table |
- | |
922 | - | ||
923 | ; read only first sector and fill variables |
- | |
924 | mov cx, 0x0001 ; first logical sector |
- | |
925 | xor dx, dx ; head = 0, drive = 0 (a:) |
- | |
926 | mov al, 1 ; read one sector |
- | |
927 | mov bx, 0xB000 ; es:bx -> data area |
- | |
928 | call boot_read_floppy |
- | |
929 | ; fill the necessary parameters to work with a floppy |
- | |
930 | mov ax, word [es:bx+24] |
- | |
931 | mov word [BPB_SecPerTrk], ax |
- | |
932 | mov ax, word [es:bx+26] |
- | |
933 | mov word [BPB_NumHeads], ax |
- | |
934 | mov ax, word [es:bx+22] |
- | |
935 | mov word [BPB_FATSz16], ax |
- | |
936 | mov ax, word [es:bx+17] |
- | |
937 | mov word [BPB_RootEntCnt], ax |
- | |
938 | mov ax, word [es:bx+11] |
- | |
939 | mov word [BPB_BytsPerSec], ax |
- | |
940 | mov ax, word [es:bx+14] |
- | |
941 | mov word [BPB_RsvdSecCnt], ax |
- | |
942 | mov ax, word [es:bx+19] |
- | |
943 | mov word [BPB_TotSec16], ax |
- | |
944 | mov al, byte [es:bx+13] |
- | |
945 | mov byte [BPB_SecPerClus], al |
- | |
946 | mov al, byte [es:bx+16] |
- | |
947 | mov byte [BPB_NumFATs], al |
- | |
948 | ; count of clusters in FAT12 ((size_of_FAT*2)/3) |
- | |
949 | mov ax, word [BPB_FATSz16] |
- | |
950 | mov cx, word [BPB_BytsPerSec] |
- | |
951 | xor dx, dx |
- | |
952 | mul cx |
- | |
953 | shl ax, 1 |
- | |
954 | mov cx, 3 |
- | |
955 | div cx ; now ax - number of clusters in FAT12 |
- | |
956 | mov word [end_of_FAT], ax |
- | |
957 | - | ||
958 | ; load first FAT table |
- | |
959 | mov cx, 0x0002 ; startcyl,startsector ; TODO!!!!! |
- | |
960 | xor dx, dx ; starthead,drive |
- | |
961 | mov al, byte [BPB_FATSz16] ; no of sectors to read |
- | |
962 | add bx, word [BPB_BytsPerSec] ; es:bx -> data area |
- | |
963 | call boot_read_floppy |
- | |
964 | mov bx, 0xB000 |
- | |
965 | - | ||
966 | ; and copy them to extended memory |
- | |
967 | mov si, movedesc |
- | |
968 | mov [si+8*2+3], bh ; from |
- | |
969 | - | ||
970 | mov ax, word [BPB_BytsPerSec] |
- | |
971 | shr ax, 1 ; words per sector |
- | |
972 | mov cx, word [BPB_RsvdSecCnt] |
- | |
973 | add cx, word [BPB_FATSz16] |
- | |
974 | mul cx |
- | |
975 | push ax ; save to stack count of words in boot+FAT |
- | |
976 | xchg ax, cx |
- | |
977 | - | ||
978 | push es |
- | |
979 | push ds |
- | |
980 | pop es |
- | |
981 | mov ah, 0x87 |
- | |
982 | int 0x15 |
- | |
983 | pop es |
- | |
984 | test ah, ah |
- | |
985 | jz @f |
- | |
986 | sayerr_floppy: |
- | |
987 | mov dx, 0x3f2 |
- | |
988 | mov al, 0 |
- | |
989 | out dx, al |
- | |
990 | mov si, memmovefailed |
- | |
991 | jmp sayerr_plain |
- | |
992 | @@: |
- | |
993 | pop ax ; restore from stack count of words in boot+FAT |
- | |
994 | shl ax, 1 ; make bytes count from count of words |
- | |
995 | and eax, 0ffffh |
- | |
996 | add dword [si+8*3+2], eax |
- | |
997 | - | ||
998 | ; copy first FAT to second copy |
- | |
999 | ; TODO: BPB_NumFATs !!!!! |
- | |
1000 | add bx, word [BPB_BytsPerSec] ; !!! TODO: may be need multiply by BPB_RsvdSecCnt !!! |
- | |
1001 | mov byte [si+8*2+3], bh ; bx - begin of FAT |
- | |
1002 | - | ||
1003 | mov ax, word [BPB_BytsPerSec] |
- | |
1004 | shr ax, 1 ; words per sector |
- | |
1005 | mov cx, word [BPB_FATSz16] |
- | |
1006 | mul cx |
- | |
1007 | mov cx, ax ; cx - count of words in FAT |
- | |
1008 | - | ||
1009 | push es |
- | |
1010 | push ds |
- | |
1011 | pop es |
- | |
1012 | mov ah, 0x87 |
- | |
1013 | int 0x15 |
- | |
1014 | pop es |
- | |
1015 | test ah, ah |
- | |
1016 | jnz sayerr_floppy |
- | |
1017 | - | ||
1018 | mov ax, cx |
- | |
1019 | shl ax, 1 |
- | |
1020 | and eax, 0ffffh ; ax - count of bytes in FAT |
- | |
1021 | add dword [si+8*3+2], eax |
- | |
1022 | - | ||
1023 | ; reading RootDir |
- | |
1024 | ; TODO: BPB_NumFATs |
- | |
1025 | add bx, ax |
- | |
1026 | add bx, 100h |
- | |
1027 | and bx, 0ff00h ; bx - place in buffer to write RootDir |
- | |
1028 | push bx |
- | |
1029 | - | ||
1030 | mov bx, word [BPB_BytsPerSec] |
- | |
1031 | shr bx, 5 ; divide bx by 32 |
- | |
1032 | mov ax, word [BPB_RootEntCnt] |
- | |
1033 | xor dx, dx |
- | |
1034 | div bx |
- | |
1035 | push ax ; ax - count of RootDir sectors |
- | |
1036 | - | ||
1037 | mov ax, word [BPB_FATSz16] |
- | |
1038 | xor cx, cx |
- | |
1039 | mov cl, byte [BPB_NumFATs] |
- | |
1040 | mul cx |
- | |
1041 | add ax, word [BPB_RsvdSecCnt] ; ax - first sector of RootDir |
- | |
1042 | - | ||
1043 | mov word [FirstDataSector], ax |
- | |
1044 | pop bx |
- | |
1045 | push bx |
- | |
1046 | add word [FirstDataSector], bx ; Begin of data region of floppy |
- | |
1047 | - | ||
1048 | ; read RootDir |
- | |
1049 | call conv_abs_to_THS |
- | |
1050 | pop ax |
- | |
1051 | pop bx ; place in buffer to write |
- | |
1052 | push ax |
- | |
1053 | call boot_read_floppy ; read RootDir into buffer |
- | |
1054 | ; copy RootDir |
- | |
1055 | mov byte [si+8*2+3], bh ; from buffer |
- | |
1056 | pop ax ; ax = count of RootDir sectors |
- | |
1057 | mov cx, word [BPB_BytsPerSec] |
- | |
1058 | mul cx |
- | |
1059 | shr ax, 1 |
- | |
1060 | mov cx, ax ; count of words to copy |
- | |
1061 | push es |
- | |
1062 | push ds |
- | |
1063 | pop es |
- | |
1064 | mov ah, 0x87 |
- | |
1065 | int 0x15 |
- | |
1066 | pop es |
- | |
1067 | - | ||
1068 | mov ax, cx |
- | |
1069 | shl ax, 1 |
- | |
1070 | and eax, 0ffffh ; ax - count of bytes in RootDir |
- | |
1071 | add dword [si+8*3+2], eax ; add count of bytes copied |
- | |
1072 | - | ||
1073 | ; Reading data clusters from floppy |
- | |
1074 | mov byte [si+8*2+3], bh |
- | |
1075 | push bx |
- | |
1076 | - | ||
1077 | mov di, 2 ; First data cluster |
- | |
1078 | .read_loop: |
- | |
1079 | mov bx, di |
- | |
1080 | shr bx, 1 ; bx+di = di*1.5 |
- | |
1081 | jnc .even |
- | |
1082 | test word [es:bx+di+0xB200], 0xFFF0 ; TODO: may not be 0xB200 !!! |
- | |
1083 | jmp @f |
- | |
1084 | .even: |
- | |
1085 | test word [es:bx+di+0xB200], 0xFFF ; TODO: may not be 0xB200 !!! |
- | |
1086 | - | ||
1087 | @@: |
- | |
1088 | jz .skip |
- | |
1089 | ; read cluster di |
- | |
1090 | ;.read: |
- | |
1091 | ;conv cluster di to abs. sector ax |
- | |
1092 | ; ax = (N-2) * BPB_SecPerClus + FirstDataSector |
- | |
1093 | mov ax, di |
- | |
1094 | sub ax, 2 |
- | |
1095 | xor bx, bx |
- | |
1096 | mov bl, byte [BPB_SecPerClus] |
- | |
1097 | mul bx |
- | |
1098 | add ax, word [FirstDataSector] |
- | |
1099 | call conv_abs_to_THS |
- | |
1100 | pop bx |
- | |
1101 | push bx |
- | |
1102 | mov al, byte [BPB_SecPerClus] ; number of sectors in cluster |
- | |
1103 | call boot_read_floppy |
- | |
1104 | push es |
- | |
1105 | push ds |
- | |
1106 | pop es |
- | |
1107 | pusha |
- | |
1108 | ; |
- | |
1109 | mov ax, word [BPB_BytsPerSec] |
- | |
1110 | xor cx, cx |
- | |
1111 | mov cl, byte [BPB_SecPerClus] |
- | |
1112 | mul cx |
- | |
1113 | shr ax, 1 ; ax = (BPB_BytsPerSec * BPB_SecPerClus)/2 |
- | |
1114 | mov cx, ax ; number of words to copy (count words in cluster) |
- | |
1115 | ; |
- | |
1116 | mov ah, 0x87 |
- | |
1117 | int 0x15 ; copy data |
- | |
1118 | test ah, ah |
- | |
1119 | popa |
- | |
1120 | pop es |
- | |
1121 | jnz sayerr_floppy |
- | |
1122 | ; skip cluster di |
- | |
1123 | .skip: |
- | |
1124 | mov ax, word [BPB_BytsPerSec] |
- | |
1125 | xor cx, cx |
- | |
1126 | mov cl, byte [BPB_SecPerClus] |
- | |
1127 | mul cx |
- | |
1128 | and eax, 0ffffh ; ax - count of bytes in cluster |
- | |
1129 | add dword [si+8*3+2], eax |
- | |
1130 | - | ||
1131 | mov ax, word [end_of_FAT] ; max cluster number |
- | |
1132 | pusha |
- | |
1133 | ; draw percentage |
- | |
1134 | ; total clusters: ax |
- | |
1135 | ; read clusters: di |
- | |
1136 | xchg ax, di |
- | |
1137 | mov cx, 100 |
- | |
1138 | mul cx |
- | |
1139 | div di |
- | |
1140 | aam |
- | |
1141 | xchg al, ah |
- | |
1142 | add ax, '00' |
- | |
1143 | mov si, pros |
- | |
1144 | cmp [si], ax |
- | |
1145 | jz @f |
- | |
1146 | mov [si], ax |
- | |
1147 | call printplain |
- | |
1148 | @@: |
- | |
1149 | popa |
- | |
1150 | inc di |
- | |
1151 | cmp di, word [end_of_FAT] ; max number of cluster |
- | |
1152 | jnz .read_loop |
- | |
1153 | pop bx ; clear stack |
- | |
1154 | - | ||
1155 | ok_sys_on_floppy: |
- | |
1156 | mov si, backspace2 |
- | |
1157 | call printplain |
- | |
1158 | mov si, okt |
- | |
1159 | call printplain |
- | |
1160 | no_sys_on_floppy: |
- | |
1161 | xor ax, ax ; reset drive |
- | |
1162 | xor dx, dx |
- | |
1163 | int 0x13 |
- | |
1164 | mov dx, 0x3f2 ; floppy motor off |
- | |
1165 | mov al, 0 |
- | |
1166 | out dx, al |
- | |
1167 | - | ||
1168 | - | ||
1169 | ; GET SMAP |
- | |
1170 | - | ||
1171 | xor ebx, ebx |
- | |
1172 | mov es, bx |
- | |
1173 | - | ||
1174 | mov edi, 0x9104 |
- | |
1175 | mov ecx, 20 |
- | |
1176 | mov edx, 0x534D4150 |
- | |
1177 | @@: |
- | |
1178 | mov [es:0x9100], ebx |
- | |
1179 | mov eax, 0xe820 |
- | |
1180 | int 0x15 |
- | |
1181 | - | ||
1182 | jc .nosmap |
- | |
1183 | cmp eax, 0x534D4150 |
- | |
1184 | jne .nosmap |
- | |
1185 | - | ||
1186 | test ebx, ebx |
- | |
1187 | jz .nosmap |
- | |
1188 | - | ||
1189 | add edi, ecx |
- | |
1190 | jmp @B |
- | |
1191 | - | ||
1192 | .nosmap: |
761 | mov [es:0x901F], al |
Line 1193... | Line 762... | ||
1193 | 762 | ||
1194 | ; SET GRAPHICS |
763 | ; SET GRAPHICS |
Line 1232... | Line 801... | ||
1232 | out dx, al ; select GDC bit mask register |
801 | out dx, al ; select GDC bit mask register |
1233 | ; for writes to 0x03cf |
802 | ; for writes to 0x03cf |
1234 | gmok2: |
803 | gmok2: |
1235 | push ds |
804 | push ds |
1236 | pop es |
805 | pop es |
- | 806 |