Compiling the demo with GCC..
Moderator:Moderators
-
- Posts:7
- Joined:Mon Mar 09, 2009 10:51 am
Hey how do i compile the demo source with gcc..
any ideas..
any ideas..
-
- Posts:7
- Joined:Mon Mar 09, 2009 10:51 am
Which parts of the tutorial are you trying to compile using GCC?
If it is only the kernel bit, then this link may help http://www.osdever.net/bkerndev/index.php. (Ignore the errors at the top)
That is an example OS using C. While it is rather more basic than what is going on here, it does inculde the specific way of using GCC to compile and link.
Hope it helps,
~Andrew
If it is only the kernel bit, then this link may help http://www.osdever.net/bkerndev/index.php. (Ignore the errors at the top)
That is an example OS using C. While it is rather more basic than what is going on here, it does inculde the specific way of using GCC to compile and link.
Hope it helps,
~Andrew

-
- Posts:7
- Joined:Mon Mar 09, 2009 10:51 am
-
- Posts:7
- Joined:Mon Mar 09, 2009 10:51 am
You can get MSVC Express edition for free and I would suggest it seeing as you are on windows.
If you dont, you will need to translate all the code into that sutable for DJGPP
As for the floppy controler, I am not aware of any libraries that will do that.
However this link might help http://wiki.osdev.org/Floppy_Disk_Controller or perhaps this one http://forum.osdev.org/viewtopic.php?t=13538.
As for Reading and Writing FAT, there are two seporate tutorials explaining exactly how to do this in the bootloader and stage2 tutorials. It should not be hard to translate them from ASM to C++.
Hope this helps,
~Andrew
If you dont, you will need to translate all the code into that sutable for DJGPP
As for the floppy controler, I am not aware of any libraries that will do that.
However this link might help http://wiki.osdev.org/Floppy_Disk_Controller or perhaps this one http://forum.osdev.org/viewtopic.php?t=13538.
As for Reading and Writing FAT, there are two seporate tutorials explaining exactly how to do this in the bootloader and stage2 tutorials. It should not be hard to translate them from ASM to C++.
Hope this helps,
~Andrew

-
- Posts:7
- Joined:Mon Mar 09, 2009 10:51 am
Real mode and protected mode do not affect how the FAT12 filesystem works.
It only affects how you read and write to the disk.
The floppy controler links I sent describe how to write a protected mode floppy controler.
Therefore, when translating from ASM, all you need to do is to replace Int0x13 with floppy_pmode_read_sector(int sectornum) or whatever you call your function
It only affects how you read and write to the disk.
The floppy controler links I sent describe how to write a protected mode floppy controler.
Therefore, when translating from ASM, all you need to do is to replace Int0x13 with floppy_pmode_read_sector(int sectornum) or whatever you call your function

-
- Posts:7
- Joined:Mon Mar 09, 2009 10:51 am
-
- Posts:7
- Joined:Mon Mar 09, 2009 10:51 am
Because of the structure of FAT12, you can only read a single sector at a time.
http://www.brokenthorn.com/Resources/OSDev11.html is a tutorial about the FAT12 filesystem.
The one difference you have is that you will need to read in sector 0 first to obtain the bpb information before futher trying to parse the data structure, in the way described in the tutorial.
http://www.brokenthorn.com/Resources/OSDev11.html is a tutorial about the FAT12 filesystem.
The one difference you have is that you will need to read in sector 0 first to obtain the bpb information before futher trying to parse the data structure, in the way described in the tutorial.
