home *** CD-ROM | disk | FTP | other *** search
-
- seg_a segment byte public
- assume cs:seg_a, ds:seg_a
-
- org 0
-
- boot proc far
-
- start:
- jmp short skp
- nop
-
- db 'IBM 20.0'
- d_000B dw 200h
- d_000D db 1
- d_000E dw 1
- d_0010 db 2
- d_0011 dw 0e0h
- db 40h,0bh,0f0h
- d_0016 dw 9
- d_0018 dw 12h
- d_001A dw 2
- d_001C dw 0
- d_001E dw 0
- db 0,0,0,0
- d_0024 db 0
- db 0, 29h, 51h, 32h, 9Dh, 18h
- db 'NO NAME FAT '
-
- skp: xor ax,ax
- mov ss,ax
- mov sp,7C00h
- call fixdrv
- mov ds,bx
- mov al,[d_0010]
- cbw
- mul word ptr [d_0016]
- add ax,[d_000E]
- push ax
- xchg ax,cx
- mov ax,20h
- mul word ptr [d_0011]
- mov bx,[d_000B]
- add ax,bx
- dec ax
- div bx
- push ax
- add ax,cx
- mov ds:[ending],ax
- mov ax,1000h
- mov es,ax
- xor di,di
- pop cx
- pop ax
- xor dx,dx
- call readsec
- xor bx,bx
- mov cx,[d_0011]
-
- l_0082:
- mov di,bx
- push cx
- mov cx,0Bh
- mov si,os2ldr
- repe cmpsb
- pop cx
- jz l_0095
- add bx,20h
- loop l_0082
-
- l_0095:
- jcxz l_00DB
- mov ax,es:[bx+1Ch]
- xor dx,dx
- div word ptr [d_000B]
- inc al
- mov cl,al
- mov dx,es:[bx+1Ah]
- dec dx
- dec dx
- mov al,[d_000D]
- xor ah,ah
- mul dx
- add ax,ds:[ending]
- adc dx,0
- mov bx,2000h
- mov es,bx
- xor di,di
- push es
- push di
- call readsec
- mov bx,ds:[ending]
- mov dl,[d_0024]
- dw 368dh,offset d_000B ;lea si,[d_000B]
- mov ax,1000h
- mov es,ax
- xor di,di
- xor dh,dh
- retf
- l_00DB:
- mov si,d_0172
- jmp short l_00E3
- l_00E0:
- mov si,d_0152
- l_00E3:
- call putstr
- mov si,d_0197
- call putstr
- sti
- l_00ED:
- jmp short l_00ED
-
- boot endp
-
- putstr proc near
- displp: lodsb
- or al,al
- jz done
- mov ah,0Eh
- mov bx,7
- int 10h ; write char al, teletype mode
- jmp short displp
- done: retn
- putstr endp
-
-
- readsec proc near
- readlp: push ax
- push dx
- push cx
- add ax,[d_001C]
- adc dx,[d_001E]
- div word ptr [d_0018]
- inc dl
- mov bl,dl
- xor dx,dx
- div word ptr [d_001A]
- mov bh,dl
- mov dx,ax
- mov ax,[d_0018]
- sub al,bl
- inc ax
- push ax
- mov ah,2
- mov cl,6
- shl dh,cl
- or dh,bl
- mov cx,dx
- xchg ch,cl
- mov dl,[d_0024]
- mov dh,bh
- mov bx,di
- int 13h ; read sectors to memory es:bx
- jc l_00E0
- pop bx
- pop cx
- mov ax,bx
- mul word ptr [d_000B]
- add di,ax
- pop dx
- pop ax
- add ax,bx
- adc dx,0
- sub cl,bl
- jg readlp
- retn
- readsec endp
-
- db 1Dh, 0
- d_0152: db 'A disk read error occurred.', 13,10,0
- db 22h, 0
- d_0172: db 'The file OS2LDR cannot be found.',13,10,0
- db 33h, 0
- d_0197: db 'Restart',0
-
- fixdrv proc near
- cli
- mov es,ax
- mov bx,78h
- lds si,es:[bx]
- mov di,4f0h ;a hopefully safe place 0040:00F0
- mov es:[bx],di
- mov es:[bx+2],es
- mov cx,11
- cld
- rep movsb
- mov byte ptr es:[di-2],0fh
- mov byte ptr es:[di-7],12h
- sti
- mov dl,0
- int 13h
- mov bx,7C0h
- ret
- fixdrv endp
-
- os2ldr: db 'OS2LDR '
- db 40 dup (0)
- db 55h, 0AAh
-
- ending label word
-
- seg_a ends
-
- end start
-