flat assembler
Message board for the users of flat assembler.

Index > OS Construction > [Req] Simple FAT32 boot loader works on flash disk

Author
Thread Post new topic Reply to topic
christiandy



Joined: 03 Mar 2011
Posts: 25
Location: 101
christiandy
Hello,
I was designing operating system but i lack of programming skill. For now, I need a boot loader that:
1. use FAT 32 BPB
2. Load FAT 32 and root directory to memory
3. Find kernel and load to memory

that's it
protected mode is unnecessary.
Anyone can help me?

thx
Post 03 Mar 2011, 10:27
View user's profile Send private message AIM Address Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I posted a link in the other post, but its best not to load the fat32 and root dir whole in memory, as unlike fat12/16 it can be very big.
Post 03 Mar 2011, 16:25
View user's profile Send private message Reply with quote
christiandy



Joined: 03 Mar 2011
Posts: 25
Location: 101
christiandy
wow, thx Dex4U. anw, i have tried the DexOS, that's my inspiration.
in the boot.asm u posted it use int 13 service 02h. But sometimes I see in another link it use int 13h services 42h. When do we use service 42? and anw can flash disk is translated to CHS? thanks so much.
Post 04 Mar 2011, 05:16
View user's profile Send private message AIM Address Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 240
Location: the-ideom
Mike Gonta
christiandy wrote:
When do we use service 42?

Hi christiandy,
Any UFD 1GB and up on any PC BIOS after 2005 (and some before) can use the Int 13h extended functions.
You are invited to participate in this inquiry.
christiandy wrote:
can flash disk is translated to CHS?

UFD geometry is emulated by the BIOS. Use Int 13h function ah=8 Get Drive Parameters to obtain the geometry
and convert the LBA for the call.
USB Booting Secrets

_________________
Mike Gonta
the-ideom - now you know how to compile

https://mikegonta.com
Post 04 Mar 2011, 11:07
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
christiandy wrote:
wow, thx Dex4U. anw, i have tried the DexOS, that's my inspiration.
in the boot.asm u posted it use int 13 service 02h. But sometimes I see in another link it use int 13h services 42h. When do we use service 42? and anw can flash disk is translated to CHS? thanks so much.
Nice to know DexOS inspiration you, I would just add to what Mike Gonta posted.
I like to stick to int 13h service 02h, when making a boot loader, from my test i have found int 13h services 42h can be buggy, not so much now, but on the first examples that came out.
Good luck, as its a long road.
Post 04 Mar 2011, 16:03
View user's profile Send private message Reply with quote
christiandy



Joined: 03 Mar 2011
Posts: 25
Location: 101
christiandy
it's the same way to access sector on harddisk and flashdisk? Dex, i have tried your code on the post but the result is only 4x4 dots on the screen. In the test i'm using 2GB flashdiks. Anw Dex, I've changed the BPB because your BPB cannot detected as FAT32


Description:
Download
Filename: test.asm
Filesize: 8.97 KB
Downloaded: 144 Time(s)

Post 06 Mar 2011, 18:05
View user's profile Send private message AIM Address Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
christiandy wrote:
it's the same way to access sector on harddisk and flashdisk? Dex, i have tried your code on the post but the result is only 4x4 dots on the screen. In the test i'm using 2GB flashdiks. Anw Dex, I've changed the BPB because your BPB cannot detected as FAT32

@christiandy, its not my code, it was a link to a fat32 boot loader, i new of.

If i was you i would stick with fat16 for usb fobs up to 2GB.
Theres a great fat12/16 boot loader called bootprog that i use.
Let me know if you want a link.
Post 06 Mar 2011, 22:57
View user's profile Send private message Reply with quote
christiandy



Joined: 03 Mar 2011
Posts: 25
Location: 101
christiandy
@Dex i still want to use FAT32 because i will try to flash disk greater than 2 gigs later. Did you have tried the code i attached. I still have no idea why it can't load the kernel
Post 07 Mar 2011, 03:24
View user's profile Send private message AIM Address Reply with quote
egos



Joined: 10 Feb 2009
Posts: 144
egos
christiandy wrote:
it's the same way to access sector on harddisk and flashdisk?
Yes. Moreover both harddisk and flashdisk can have same boot loader.

_________________
If you have seen bad English in my words, tell me what's wrong, please.
Post 07 Mar 2011, 04:57
View user's profile Send private message Reply with quote
christiandy



Joined: 03 Mar 2011
Posts: 25
Location: 101
christiandy
yes it's same but i still don't understand my boot code not work
Post 08 Mar 2011, 18:13
View user's profile Send private message AIM Address Reply with quote
egos



Joined: 10 Feb 2009
Posts: 144
egos
For first time:
- check BPB. It is seems to me that BPB_Reserved field has size 12 bytes;
- use even value for sp;
- to calculate location of data area use formulae BPB_HiddenSectors32 + BPB_ReservedSectors + BPB_NumberOfFATs*BPB_SectorsPerFAT32;
- don't truncate 32-bit values;
- and so on.
Post 09 Mar 2011, 10:00
View user's profile Send private message Reply with quote
lagg070988



Joined: 09 Jul 2011
Posts: 5
lagg070988
hi, my english is bad but i have this solution for this problem


Description: boot on fat32 of any partition
Download
Filename: fat32.ASM
Filesize: 4.11 KB
Downloaded: 167 Time(s)

Post 02 Sep 2011, 01:35
View user's profile Send private message MSN Messenger Reply with quote
lagg070988



Joined: 09 Jul 2011
Posts: 5
lagg070988
comment are in spanish Smile
i'm chilean
Post 02 Sep 2011, 01:41
View user's profile Send private message MSN Messenger 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.