tix2 ALors toi,hein ,je serais ta m | Salut
On tente, ave cun pote, de coder un petit kernel simpliste (but purement intellectuel -_-')... j'avais quelque snotions de mode réel, en basic, et en C ... mais aucune, ou presque d'assembleur ...
je m'y suis donc mis il ya deux jours et ca se passe bien. mais bien entendu, j'ai besoin d'un peu d'aide.
alors voilà le probleme :
j'ai récuperé un code de boot pour l'étudier, et en connaitre un peu plus sur le sujet, mais certaines lignes sont bine floues, voilà le code entier, auquel j'ai apporté deux ou trois modifs ...
Code :
- ;************************************************************
- ; Program entry point
- ; Currently we are at 0:7C00
- ;************************************************************
- org 0
- EntryPoint:
- ; Would have preferred 07C0:0000
- ; Dealing with an offset that starts at 0 is easier
- ; So do a far jump to 07C0:????
- jmp 0x07C0:AfterData
- ;°²ÛÜßÈÉÊËÌÍμ»º¹¿ÀÅÄÃÂÁÙÚ È¼
- ; Your Data goes here!
- BOOT_MSG db 'Booting ...',10,13,0
- ACTIVITY db '°±²Û²±°',0
- AfterData:
- ; update DS to be 7C0 instead of 0
- push CS
- pop DS
- ; update ES also
- push CS
- pop ES
- ; create stack
- mov ax, 0x0000
- mov ss, ax
- mov sp, 0xFFFF
- ; charge le mode 12H
- ; code ajouté apres coup
- ;mov ah, 0x00
- ;mov al, 0x12
- ;int 0x10
- ; display boot message...
- lea si, [BOOT_MSG]
- call Print
- ; Go into a hang printing dots
- DIE_LOOP:
- lea si, [ACTIVITY]
- call Print
- mov cx, 0xffff
- delay1:
- mov bx, 0xfff
- delay2:
- dec bx
- jnz delay2
- dec cx
- jnz delay1
- jmp DIE_LOOP
- ;************************************************************
- ; Procedure print
- ; prints a zero terminated string pointed to by si
- ;************************************************************
- Print:
- push ax
- mov ah, 14 ; BIOS code for screen display
- cld
- print_loop:
- lodsb ; moving the character to be displayed to al
- or al, al ; checking if the char is NULL
- jz printdone
- int 10h ; Calling BIOS routine
- JMP print_loop
- printdone:
- pop ax
- ret
- ; End of print procedure...
- ; Make the file 512 bytes long
- TIMES 510-($-$$) DB 0
- ; Add the boot signature
- dw 0AA55h
|
or voilà. j'ai tenté de passé en 12H, pour, par la suite, coder un genre de bmploader simpliste, avec ceci
Code :
- mov ah, 0x00
- mov al, 0x12
- int 0x10
|
a verifier, je ne pense pas avoir commis d'erreurs ..
toujours est il que, là, il ya bug :
la fonction "print" ne marchre plus ...
j'ai essayé de la modifier en utilisant une autre fonction de l'interruption 10h (0x09) mais, meme probleme, ou preque...
auriez vous une solution? (je posterai le code testé au besoin)
2eme question : le stack ...
je n'ai pas compris ces lignes :
Code :
- EntryPoint:
- ; Would have preferred 07C0:0000
- ; Dealing with an offset that starts at 0 is easier
- ; So do a far jump to 07C0:????
- jmp 0x07C0:AfterData
- ; Your Data goes here!
- ...
- AfterData:
- ; update DS to be 7C0 instead of 0
- push CS ;<< ?
- pop DS ;<< ?
- ; update ES also
- push CS ;<< ?
- pop ES ;<< ?
- ; create stack
- mov ax, 0x0000;<< ?
- mov ss, ax ;<< ?
- mov sp, 0xFFFF;<< ?
|
à quoi servent donc ces choses là ?
je me suis renseigné sur l'utilité de la pile, mais je ne la reconais pas ici ....
auriez vous une explication claire de ce code (comms détaillés ou autres ..)
bref, voilà
Assembleur : Nasm 16Bits Systeme : PC ...
merci beaucoup pour votre (esperée) aide, ++ Tix. Message édité par tix2 le 05-02-2008 à 22:21:11 ---------------
Actuellement : <img src=\\\\\\\"http://www.bencastricum.nl/msn/status.php/26231b22-af9b-4ecf-a5b4-7b12014833d4.png\\\\\\\">
|