OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:52 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 9:16 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
Klakap wrote:
Can you figure out if dl on non-working computers is 0x00 or 0x80?


It's exact, the working PC has DL = 0x80 and same for QEMU

The others have 0x00


Top
 Profile  
 
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 9:39 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Well, this is also exact situation. DL=0x00 mean that computer is emulating USB like floppy disk. It happens because you start code with short jmp. Your computers are assuming that you have written BPB, because it also start with short jump. So BIOS read values from BPB - in this case from your code and it is why it do not work - BIOS is initalized with wrong values. Try to remove jmp from start of your code and read if dl value changed from 0x00 to 0x80. DL=0x80 mean that USB is emulates as hard disk and it is what we want.

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 10:10 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
Klakap wrote:
Well, this is also exact situation. DL=0x00 mean that computer is emulating USB like floppy disk. It happens because you start code with short jmp. Your computers are assuming that you have written BPB, because it also start with short jump. So BIOS read values from BPB - in this case from your code and it is why it do not work - BIOS is initalized with wrong values. Try to remove jmp from start of your code and read if dl value changed from 0x00 to 0x80. DL=0x80 mean that USB is emulates as hard disk and it is what we want.


Still DL = 0

Else the fun fact is that when Ive started developing OS, ive done that with laptop only until now and it appears that only laptop's BIOS do not have this floppy protocol but desktop's BIOS do (even recent ones)

My Both desktops do have this floppy issue but not my laptop (another laptop from my first one).


Top
 Profile  
 
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 10:21 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Quote:
My both of my desktop do have this floppy issue

It sounds like problem is lying in BIOS settings. Try to go to BIOS settings and look if you do not have something like USB emulating = Floppy and try to change it on Hard disk. Or if not, try to remain space for BPB:
Code:
jmp Bootloader.Code.Entry
times 0x3E db 0 ;BPB

Or try to write BPB values for yourself.

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 11:28 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
Klakap wrote:
Quote:
My both of my desktop do have this floppy issue

It sounds like problem is lying in BIOS settings. Try to go to BIOS settings and look if you do not have something like USB emulating = Floppy and try to change it on Hard disk. Or if not, try to remain space for BPB:
Code:
jmp Bootloader.Code.Entry
times 0x3E db 0 ;BPB

Or try to write BPB values for yourself.


Perfect, thank you very much and yes there is no setting to turn off the floppy thing.
=D>

The BIOS list the USB device as diskette in my BIOS.


Top
 Profile  
 
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 11:32 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Great! :D You can edit thread title to [solved]. Just for interest, is it working with BPB as zero, or you write your own BPB?

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 11:37 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
Klakap wrote:
Great! :D You can edit thread title to [solved]. Just for interest, is it working with BPB as zero, or you write your own BPB?


Oof is that a DOS thing ? https://en.wikipedia.org/wiki/BIOS_parameter_block

Yes it's worked with BPB filled with zero.


Top
 Profile  
 
 Post subject: Re: [SOLVED] Int 0x13 doesn't want to load up my kernel, str
PostPosted: Mon Aug 02, 2021 11:45 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Quote:

BPB is not only DOS thing, but it is connected with FATxx system, so in this way it was also DOS thing.
Quote:
Yes it's worked with BPB filled with zero.

Thanks for answer. :)

And for last tip for future, if BIOS emulate USB like hard disk, you can use int 13h ah=42h for reading your code. It is much more easier than ah=0x2.

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: [SOLVED] Int 0x13 doesn't want to load up my kernel, str
PostPosted: Mon Aug 02, 2021 11:51 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
Klakap wrote:
Quote:

BPB is not only DOS thing, but it is connected with FATxx system, so in this way it was also DOS thing.
Quote:
Yes it's worked with BPB filled with zero.

Thanks for answer. :)

And for last tip for future, if BIOS emulate USB like hard disk, you can use int 13h ah=42h for reading your code. It is much more easier than ah=0x2.


Image


Top
 Profile  
 
 Post subject: Re: Int 0x13 doesn't want to load up my kernel, strange
PostPosted: Mon Aug 02, 2021 12:58 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
Klakap wrote:
Your computers are assuming that you have written BPB, because it also start with short jump. So BIOS read values from BPB - in this case from your code and it is why it do not work - BIOS is initalized with wrong values. Try to remove jmp from start of your code and read if dl value changed from 0x00 to 0x80.

Some BIOSes don't even check the instruction and blindly assume the BPB is there and just write over the area the BPB would be in when emulating a floppy device.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 58 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group