Subversion Repositories Kolibri OS

Rev

Rev 7121 | Rev 7132 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7121 Rev 7129
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: 7121 $
14
$Revision: 7129 $
15
 
15
 
16
 
16
 
Line 272... Line 272...
272
; set up segment registers
272
; set up segment registers
273
        push    cs
273
        push    cs
274
        pop     ds
274
        pop     ds
275
else
275
else
276
        cld
276
        cld
-
 
277
        push    0
-
 
278
        pop     es
277
; \begin{diamond}[02.12.2005]
279
; \begin{diamond}[02.12.2005]
278
; if bootloader sets ax = 'KL', then ds:si points to loader block
280
; if bootloader sets ax = 'KL', then ds:si points to loader block
279
        cmp     ax, 'KL'
281
        cmp     ax, 'KL'
280
        jnz     @f
282
        jnz     @f
281
        mov     word [cs:cfgmanager.loader_block], si
283
        mov     word [cs:cfgmanager.loader_block], si
282
        mov     word [cs:cfgmanager.loader_block+2], ds
284
        mov     word [cs:cfgmanager.loader_block+2], ds
-
 
285
        mov     word [es:BOOT_KERNEL_RESTART], kernel_restart_bootblock
283
@@:
286
@@:
284
; \end{diamond}[02.12.2005]
287
; \end{diamond}[02.12.2005]
Line 285... Line 288...
285
 
288
 
286
; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source hard disk
289
; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source disk
-
 
290
; (see comment to BOOT_BX_FROM_LOAD and loader_doc.txt)
287
; (see comment to bx_from_load)
291
        mov     word [es:BOOT_BX_FROM_LOAD], 'r1'  ; default value: /rd/1
288
        cmp     cx, 'HA'
292
        cmp     cx, 'HA'
289
        jnz     no_hd_load
293
        jnz     no_hd_load
290
        cmp     dx, 'RD'
294
        cmp     dx, 'RD'
291
        jnz     no_hd_load
295
        jnz     no_hd_load
292
        mov     word [cs:bx_from_load], bx              ; {SPraid}[13.03.2007]
296
        mov     [es:BOOT_BX_FROM_LOAD], bx
Line 293... Line 297...
293
no_hd_load:
297
no_hd_load:
294
 
298
 
295
; set up stack
299
; set up stack
Line 964... Line 968...
964
 
968
 
Line 965... Line 969...
965
; BOOT DEVICE
969
; BOOT DEVICE
966
 
970
 
967
        mov     al, [preboot_device]
971
        mov     al, [preboot_device]
Line 968... Line 972...
968
        dec     al
972
        dec     al
969
        mov     [boot_dev], al
973
        mov     [es:BOOT_DEV], al
Line 970... Line 974...
970
 
974
 
Line 971... Line 975...
971
; GET MEMORY MAP
975
; GET MEMORY MAP
972
include '../detect/biosmem.inc'
976
include '../detect/biosmem.inc'
973
 
977
 
974
; READ DISKETTE TO MEMORY
978
; READ DISKETTE TO MEMORY
975
 
979
 
976
        cmp     [boot_dev], 0
980
        cmp     byte [es:BOOT_DEV], 0
Line 1298... Line 1302...
1298
        mov     dx, 0x3f2       ; floppy motor off
1302
        mov     dx, 0x3f2       ; floppy motor off
1299
        mov     al, 0
1303
        mov     al, 0
1300
        out     dx, al
1304
        out     dx, al
Line 1301... Line 1305...
1301
 
1305
 
1302
if defined extended_primary_loader
1306
if defined extended_primary_loader
1303
        cmp     [boot_dev], 1
1307
        cmp     [es:BOOT_DEV], 1
1304
        jne     no_sys_from_primary
1308
        jne     no_sys_from_primary
1305
; load kolibri.img using callback from primary loader
1309
; load kolibri.img using callback from primary loader
1306
        and     word [movedesc + 24 + 2], 0
1310
        and     word [movedesc + 24 + 2], 0
1307
        mov     byte [movedesc + 24 + 4], 10h
1311
        mov     byte [movedesc + 24 + 4], 10h