1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
| [BITS 16]
[ORG 0]
jmp start
bootdrv db 0
bootmsg db 'boot loader !!!',13,10,0
rebootmsg db 'Redemarrage...',13,10,0
processormsg db 'Checking for 386+ processor : ',0
need386 db 'Sorry... 386+ required !',13,10,0
found386 db 'Found!',13,10,0
whatever db 'Long life!', 13,10,0
detect_cpu:
mov si, processormsg
call message
pushf
xor ah,ah
push ax
popf
pushf
and ah, 0F0h
cmp ah, 0F0h
je no386
mov ah, 0F0h
push ax
popf
pushf
pop ax
and ah,0F0h
jz no386
popf
mov si, found386
call message
ret
no386 :
mov si, need386
call message
jmp reboot
message :
lodsb
or al,al
jz done
mov ah,0Eh
mov bx,0007
int 10h
jmp message
done:
ret
getkey:
mov ah, 0
int 16h
ret
reboot:
mov si, rebootmsg
call message
call getkey
db 0EAh
dw 0000h
dw 0FFFFh
start:
mov ax,07C0h
mov ds,ax
mov [bootdrv], dl
cli
mov ax,9000h
mov ss,ax
mov sp,0FFFFh
sti
mov si,bootmsg
call message
call detect_cpu
.386
mov si,whatever
call message
call getkey
call reboot
times 510-($-$$) db 0
dw 0xAA55 |
Partager