Three diffrent emulators show three diffrent outputs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Three diffrent emulators show three diffrent outputs

Post by neon »

Sure. Just use int 13h function 42h which is the extended read function. Keep in mind that the BIOS (or a chain loader) gives you the device number in DL. Use this number in the above interrupt call to access the boot device (which would be your CD.) The extended read function is also useful for hard disks as well. You will have to still implement ISO 9660 read support though.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Three diffrent emulators show three diffrent outputs

Post by Brendan »

Hi,
lukaandjelkovic wrote:Is there any possibility to read CD ATAPI through interrupts in real mode?
If you booted from CD using "El Torito, no emulation" then BIOS will tell your code a drive number that can be used to read from that CD using "Int 0x13, Extended Read". Note that for "El Torito, no emulation" your boot loader can be up to about 500 KiB (and the BIOS will/should load all of it, not just the first sector of it).

If you didn't boot from CD, then you might not be able to use any BIOS functions to access any CD (even if a CD is present), or you might be able to use BIOS functions to access one or more CDs.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Three diffrent emulators show three diffrent outputs

Post by neon »

No #-o - oh sorry, i wrongly wrote my reply. I meant just documentation for real mode and protected mode. I know that filesystems doesn't depend on file formats, and it's easy to make it load PE executable. I understand whole bootloader, don't make that assumptions. I accidentally added that "bootloader for PE files"
Sorry, I missed this bit. As long as you know what it does then there is no problem. :) I just wanted to be sure. Note though that, in the series, we use /ALIGN:512 in the linker settings to simplify loading the file. If you switch to a CD, you should use /ALIGN:2048. In a real system, it should be done section by section taking section alignment into consideration (which is typically paged aligned.) This is a little more harder to do, but is something to perhaps look into later.
If i even don't understand and don't know, it's still just a little bit better than using Grub, isn't it?
I don't copy paste your demos since 1 month or more. I write it by myself - and most things from demo got rewritten by me until version 0.0.1 was released.
I am fine with copying and pasting. My only concern is copying and pasting code without knowing the why of what it does and without consideration for the design and architecture of your system.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Ycep
Member
Member
Posts: 401
Joined: Mon Dec 28, 2015 11:11 am

Re: Three diffrent emulators show three diffrent outputs

Post by Ycep »

Hmmm, no. No CDs until i give up.
Post Reply