Je suis en train de bidouiller avec la création d'un propre bootloader (MBR). C'est ma première étape pour mieux comprendre les systèmes d'exploitation.Démarrage de Parallels Virtual Machine avec son propre bootloader écrit sur un fichier Iso
Ma configuration est:
MacBook Air, OsX 10.8.4, Parallels Desktop, Xcode, des outils de ligne de commande XCode, Nasm, LD, gcc, ...
J'ai composé une botte chargeur:
;
; FpLoader.s
;
bits 16 ; 16-bit Real Mode
org 0x7c00 ; Set origin to BIOS boot origin
;
; Bootloader entry-code
;
Main: cli ; Enable interrupts
mov ax, cs ; Setup stack segments
mov ds, ax
mov es, ax
mov ss, ax
sti ; Enable interrupts
mov si, Message_1 ; Print string
call PrintLn
mov si, Message_2 ; Print string
call PrintLn
call PrintCrLf
call PrintCrLf
call Reboot
;
; Read keypress
;
ReadKeypress:
mov ah, 0 ; BIOS function - Wait for and read keyboard
int 0x16 ; Call BIOS Keyboard Service
ret ; Return from procedure
;
; PrintLn string
;
PrintLn:
lodsb ; Load [Si] in Al and increment Si
or al, al ; Check if end of string reached (Al == 0)
jz .PrintLnEnd
mov ah, 0x0e ; BIOS function - Print character on screen
int 0x10 ; Call BIOS Screen Service
jmp PrintLn ; Loop
.PrintLnEnd call PrintCrLf
;
; Print Cr/Lf
PrintCrLf: mov ah, 0x0E ; BIOS function - Print character on screen
mov al, 0x0D ; Character to print: Cr
int 0x10 ; Call BIOS Screen Service
mov al, 0x0A ; Character to print: Lf
int 0x10 ; Call BIOS Screen Service
ret ; Return from procedure
;
; Reboot the machine
;
Reboot: mov si, AnyKey ; Print string
call PrintLn
call ReadKeypress
db 0x0ea ; Sends us to the end of the memory causing reboot
dw 0x0000
dw 0xffff
;
; Data
;
; Program data
Message_1 db "Hello World...", 0x0
Message_2 db "Painted Black bootloader.", 0x0
AnyKey db "Press any key to reboot...", 0x0
; Filler bytes
times 510 - ($-$$) db 0
; Trailer bytes
dw 0xAA55 ;Boot signature
J'assemblage avec ce code:
nasm -f bin FpLoader.s -o FpLoader.img
sudo dd if=FpLoader.img of=FpLoader.iso bs=2k
Lorsque j'essaie de démarrer une machine virtuelle Parallels à partir de FpLoader.iso, il refuse de démarrer, me disant qu'il ne peut pas démarrer à partir de l'iso (configuré comme un CD dans la configuration de Parallels).
Puisque je suis complètement nouveau sur le sujet et que je suis curieux de savoir comment utiliser les outils dont je dispose, j'apprécierais toute aide que vous pourriez m'apporter.
J'ai trouvé un certain nombre de solutions partielles pour Linux, Bochs, ... mais rien ne m'a vraiment orienté dans la bonne direction.
Je ne suis pas rigide à propos du fichier Iso. Si quelqu'un peut me montrer un moyen avec un fichier img, un vrai USB amorçable (dans Parallels Virtual Machine), ou une autre solution (compatible avec ma configuration) pour tester mes développements, ça ira aussi bien.
Merci à l'avance et salutations, PB
Dans le même temps, j'ai trouvé la solution: ** "dd if =/dev/zero of = FpLoader.img bs = 1024 count = 1440" ** et par la suite ** "dd if = FpLoader.bin de = FpLoader.imb bs = 1 compte = 512 conv = notrunc" **. Enfin, connectez une disquette virtuelle à la machine virtuelle et associez cette disquette virtuelle au FpLoader.img créé. –
ressemble à une réponse à une question assez intéressante, vous devriez la mettre en réponse avec toutes les informations pertinentes que vous avez réussi à trouver. –