flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Passing execution to the bootsector in sector 3 fails

Author
Thread Post new topic Reply to topic
plaster90



Joined: 03 Jun 2014
Posts: 17
plaster90 03 Jun 2014, 07:33
Hello.
sorry for my english.
i got big problem with "protect" my system.
i copied my win bootsector to sector no 3. in sector 1 i load my own bootsector witch ask for password. When password correct MBR load sector from 3 to the memory.

when i jmp to this location system fails. Example code:


mov ax,8000h
mov es,ax

mov ax,0201h
mov dh,1
mov dl,80h
mov cx,3
xor bx,bx
int 13h

jmp 8000h:0000h

hope someone help:)
Post 03 Jun 2014, 07:33
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 03 Jun 2014, 17:26
looks like you're trying to read from the 1st head (mov dh, 1). heads and cylinders count from 0, only sectors count from 1.
Post 03 Jun 2014, 17:26
View user's profile Send private message Reply with quote
plaster90



Joined: 03 Jun 2014
Posts: 17
plaster90 03 Jun 2014, 18:58
yeh its something like this:

ORG 0x7C00


main:
mov ax,0x0000
mov ds,ax

mov ax,8000h
mov es,ax
mov ax,0201h
mov ch,0
mov cl,1
mov dh,0
mov dl,80h
xor bx,bx
int 13h


jmp 8000h:0000h



but still dosn't work.....
Post 03 Jun 2014, 18:58
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC 04 Jun 2014, 00:03
perhaps it's not disk 0x80? the BIOS loads DL with a code for the current boot disk. this code is specific to how many discs you have and their order.
Post 04 Jun 2014, 00:03
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 04 Jun 2014, 03:48
plaster90,

Perhaps MBR you're loading expects to find itself somewhere around 0:7C00? Moreover, in your last example (can you use [code] tags?) you're trying to load sector from 0/0/1.
Post 04 Jun 2014, 03:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.