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
|
%define BASE 0x100
%define KSIZE 1 ; nombre de secteurs de 512 octets a charger
[BITS 16]
[ORG 0x0]
mov [bootdrv], dl ; recuparation de l'unite de boot
; initialisation des segments en 0x07C0
mov ax, 0x07C0
mov ds, ax
mov es, ax
mov ax, 0x8000 ; stack en 0xFFFF
mov ss, ax
mov sp, 0xf000
; affiche un msg
mov si, msgDebut
call afficher
; charger le noyau
xor ax, ax
int 0x13
push es
mov ax, BASE
mov es, ax
mov bx, 0
mov ah, 2
mov al, KSIZE
mov ch, 0
mov cl, 2
mov dh, 0
mov dl, [bootdrv]
int 0x13
pop es
; saut vers le kernel
jmp dword BASE:0
msgDebut: db "Chargement du kernel", 13, 10, 0
bootdrv: db 0
; fonction
afficher:
push ax
push bx
.debut:
lodsb ; ds:si -> al
cmp al, 0 ; fin chaine ?
jz .fin
mov ah, 0x0E ; appel au service 0x0e, int 0x10 du bios
mov bx, 0x07 ; bx -> attribut, al -> caractere ascii
int 0x10
jmp .debut
.fin:
pop bx
pop ax
ret
;; NOP jusqu'a 510
times 510-($-$$) db 144
dw 0xAA55 |
Partager