Rev 1065 | Rev 2288 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1065 | Rev 1132 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | ; check LBA support |
40 | ; check LBA support |
41 | mov ah, 41h |
41 | mov ah, 41h |
42 | mov bx, 55AAh |
42 | mov bx, 55AAh |
43 | int 13h |
43 | int 13h |
44 | mov si, aNoLBA |
44 | mov si, aNoLBA |
45 | jc err |
45 | jc err_ |
46 | cmp bx, 0AA55h |
46 | cmp bx, 0AA55h |
47 | jnz err |
47 | jnz err_ |
48 | test cl, 1 |
48 | test cl, 1 |
49 | jz err |
49 | jz err_ |
50 | ; get file system information |
50 | ; get file system information |
51 | ; scan for Primary Volume Descriptor |
51 | ; scan for Primary Volume Descriptor |
52 | db 66h |
52 | db 66h |
53 | push 10h-1 |
53 | push 10h-1 |
54 | pop eax |
54 | pop eax |
Line 58... | Line 58... | ||
58 | mov bx, 0x1000 |
58 | mov bx, 0x1000 |
59 | call read_sectors |
59 | call read_sectors |
60 | jnc @f |
60 | jnc @f |
61 | fatal_read_err: |
61 | fatal_read_err: |
62 | mov si, aReadError |
62 | mov si, aReadError |
63 | err: |
63 | err_: |
64 | call out_string |
64 | call out_string |
65 | mov si, aPressAnyKey |
65 | mov si, aPressAnyKey |
66 | call out_string |
66 | call out_string |
67 | xor ax, ax |
67 | xor ax, ax |
68 | int 16h |
68 | int 16h |
Line 82... | Line 82... | ||
82 | jz pvd_found |
82 | jz pvd_found |
83 | cmp byte [bx], 0xFF ; Volume Descriptor Set Terminator? |
83 | cmp byte [bx], 0xFF ; Volume Descriptor Set Terminator? |
84 | jnz pvd_scan_loop |
84 | jnz pvd_scan_loop |
85 | ; Volume Descriptor Set Terminator reached, no PVD found - fatal error |
85 | ; Volume Descriptor Set Terminator reached, no PVD found - fatal error |
86 | mov si, no_pvd |
86 | mov si, no_pvd |
87 | jmp err |
87 | jmp err_ |
88 | pvd_found: |
88 | pvd_found: |
89 | add bx, 80h |
89 | add bx, 80h |
90 | mov ax, [bx] |
90 | mov ax, [bx] |
91 | mov [lb_size], ax |
91 | mov [lb_size], ax |
92 | ; calculate number of logical blocks in one sector |
92 | ; calculate number of logical blocks in one sector |
Line 101... | Line 101... | ||
101 | stosd |
101 | stosd |
102 | ; get memory size |
102 | ; get memory size |
103 | int 12h |
103 | int 12h |
104 | mov si, nomem_str |
104 | mov si, nomem_str |
105 | cmp ax, 71000h / 400h |
105 | cmp ax, 71000h / 400h |
106 | jb err |
106 | jb err_ |
107 | shr ax, 1 |
107 | shr ax, 1 |
108 | sub ax, 60000h / 800h |
108 | sub ax, 60000h / 800h |
109 | mov [size_rest], ax |
109 | mov [size_rest], ax |
110 | mov [free_ptr], 60000h / 800h |
110 | mov [free_ptr], 60000h / 800h |
111 | ; load path table |
111 | ; load path table |
Line 157... | Line 157... | ||
157 | mov si, callback |
157 | mov si, callback |
158 | jmp far [si-callback+secondary_loader_info] ; jump to 1000:0000 |
158 | jmp far [si-callback+secondary_loader_info] ; jump to 1000:0000 |
Line 159... | Line 159... | ||
159 | 159 | ||
160 | noloader: |
160 | noloader: |
161 | mov si, aKernelNotFound |
161 | mov si, aKernelNotFound |
Line 162... | Line 162... | ||
162 | jmp err |
162 | jmp err_ |
163 | 163 | ||
164 | read_sectors: |
164 | read_sectors: |
165 | ; es:bx = pointer to data |
165 | ; es:bx = pointer to data |