|
|
| version 1.1, 2004/01/22 01:10:04 | version 1.3, 2004/03/19 00:30:01 |
|---|---|
| Line 1 | Line 1 |
| .186 | |
| CODE SEGMENT | ORG 0 |
| ASSUME CS:CODE,DS:nothing,ES:nothing,SS:nothing | USE16 |
| ORG 0000H | CPU 8086 |
| FIXCS equ 2eh | segment .scsi start=0x0000 |
| START: retf ; 00 | retf ; 00 |
| nop | nop |
| nop | nop |
| retf ; 03 | retf ; 03 |
| Line 16 START: retf ; 00 | Line 15 START: retf ; 00 |
| nop | nop |
| nop | nop |
| db 055h, 0aah, 002h ; 09 | db 055h, 0aah, 002h ; 09 |
| jmp short scsi_init1 ; 0c | jmp short init1 ; 0c |
| nop | nop |
| jmp short scsi_init2 ; 0f | jmp short init2 ; 0f |
| nop | nop |
| retf ; 12 | retf ; 12 |
| nop | nop |
| nop | nop |
| jmp short scsi_boot ; 15 | jmp short boot ; 15 |
| nop | nop |
| jmp short scsi_bios ; 18 | jmp short bios ; 18 |
| nop | nop |
| retf ; 1b | retf ; 1b |
| nop | nop |
| Line 49 START: retf ; 00 | Line 48 START: retf ; 00 |
| nop | nop |
| nop | nop |
| scsi_init1: mov word ptr [bx], 082c2h | init1: mov word [bx], 0x82c2 |
| retf | retf |
| scsi_init2: mov ax, cs | init2: mov ax, cs |
| mov ds:[04b2h], ah | mov [0x04b2], ah |
| mov ds:[04bah], ah | mov [0x04ba], ah |
| mov ds:[04bch], ah | mov [0x04bc], ah |
| mov ax, 0320h | mov ax, 0x0320 |
| int 1bh | int 0x1b |
| retf | retf |
| scsi_bios: cld | bios: cld |
| mov dx, cs | mov dx, cs |
| mov ds, dx | mov ds, dx |
| mov cx, 8 | mov cx, 8 |
| mov si, offset scsibiosstr | mov si, scsibiosstr |
| test byte ptr [bp], 40h | test byte [bp], 0x40 |
| je short scsisend | je short .send |
| lea si, [si + 8] | lea si, [si + 8] |
| scsisend: mov dx, 07efh | .send: mov dx, 0x07ef |
| cli | cli |
| rep outsb | .loop: lodsb |
| out dx, al | |
| loop .loop | |
| sti | sti |
| pop ax | pop ax |
| pop bx | pop bx |
| Line 83 scsisend: mov dx, 07efh | Line 84 scsisend: mov dx, 07efh |
| pop ds | pop ds |
| iret | iret |
| scsi_boot: cmp al, 0ch | boot: cmp al, 0x0c |
| jne short boot_exit | jne short .exit |
| mov ax, 4620h | mov ax, 0x4620 |
| mov cx, 1fc0h | mov cx, 0x1fc0 |
| mov es, cx | mov es, cx |
| mov bp, bx | xor bp, bp |
| mov cx, bx | mov bx, 0x400 |
| mov dx, bx | xor cx, cx |
| mov bh, 4 | xor dx, dx |
| int 1bh | int 0x1b |
| jc short boot_exit | jc short .exit |
| or al, 80h | or al, 0x80 |
| mov byte ptr ds:[0584h], al | mov [0x0584], al |
| db 9ah ; call far | db 0x9a ; call far |
| dw 0 | dw 0x0000 |
| dw 1fc0h | dw 0x1fc0 |
| boot_exit: retf | .exit: retf |
| scsibiosstr db "scsibios" | scsibiosstr db "scsibios" |
| db "scsi_dev" | db "scsi_dev" |
| CODE ENDS | ends |
| END START | |