flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
DJ Mauretto 29 May 2008, 13:39
Code: org 7E00h use16 main: ;Move itself to other place cli push 0 pop ds mov ax, 9000h ;We have an intention to move our code into segment 9000h mov ss, ax mov sp, 7E00h ;ss:sp=9000:7E00 mov es, ax ;es=9000 mov si, 7E00h ;si=7E00 mov di, 7E00h ;di=7E00 mov cx, main_length ;Full length. rep movsb ;Copy from 0000:7E00 to 9000:7E00. sti it's not all code , post boot code and The 5th sector of zero cylinder. You Boot From Floppy ? Hard disk ? All code please and explain what do you make it . ![]() _________________ Nil Volentibus Arduum ![]() |
|||
![]() |
|
revolution 29 May 2008, 14:18
Even though you don't have a debugger, you still have options for debugging.
Use the screen. Output single characters to the screen to show at what point your code has got to. A simple sequence of A-B-C-D-... would be enough. It is one of the oldest ever "debuggers", and often still the most effective in certain situations (like a boot loader). Use a VM: QEMU, Virtual PC, Bochs, ... Some of them have debugging modes. |
|||
![]() |
|
FASMresearcher 29 May 2008, 14:31
The 5th sector contains the copy of the original MBR.
The code from the first sector simply reads the code given above to es:bx. I boot from the hard disk 0. First sector code: Code: org 7C00h use16 bootcode: cli xor ax, ax mov ss, ax mov sp, 7C00h push cs pop ds push ax pop es sti mov bx, end_offset ; mov ah, 02h mov al, 10 ; Count of sectors mov ch, 0 mov cl, 6 ;Start sector (code above) mov dh, 0 mov dl, 80h ; HDD0 int 13h jmp 0000:7E00h ;------------------------------------------------------------- rb 7C00h + 512 - 2 -$ ;Fill with zero the rest of the sector. db 055h,0AAh end_offset = $ |
|||
![]() |
|
revolution 29 May 2008, 14:43
What are you expecting to see? Your int13 handler blocks all read attempts and then "Print content of the current sector onto the screen."
But here is probably where the problem is: "It was excluded". I suggest that your problem is in the code you excluded. We can't help you if you hide information, we have to guess that "you know what you are doing" but that can be very dangerous for us to guess. If you exclude something then we will naturally think that your problems lies there because we can't see it. Have a look at this thread, and read all of it from start to finish. Then you will see why you must show all your code. You, and me, cannot assume that your excluded part is not where the problem lies. If we assume then we make an ASS out of U and ME. ![]() |
|||
![]() |
|
FASMresearcher 29 May 2008, 14:56
You too distrust.
I hide nothing. This code REALLY full. I execute THIS code, without any other routines. Concretely this code does not work. Last edited by FASMresearcher on 29 May 2008, 15:04; edited 1 time in total |
|||
![]() |
|
revolution 29 May 2008, 15:01
FASMresearcher wrote: You too distrust. Code: ... cmp ah, 02h ;In this case go to the label to_read. jz .to_read ;Not - to the original int 13. call Original_13 jmp .Handler_end .to_read: ;call ShowSector ; Print content of the current sector onto the screen. It was excluded. .Handler_end: iret Case closed, right? |
|||
![]() |
|
FASMresearcher 29 May 2008, 15:14
Hmmmmm.... I suspected something of this kind…
It seems to me you are right. I try my code for checking this line tomorrow. Thank you for help! |
|||
![]() |
|
FASMresearcher 30 May 2008, 14:22
revolution wrote: You never allow "read" (AH=2) to proceed, then the MBR can never run properly. Yeeessss!!! Of course!!! Thanks a lot! I have changed the similar expressions and code became workable. I appreciate for your help! ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.