Page 1 of 1

The best way to load files with int 13h in a FAT 16 fs

Posted: Sat Sep 11, 2010 6:50 am
by Karlosoft
Hi! My bootloader is very slow in reading files (more than one minute and 30 seconds to load a 190kb file). How do you usually perform the code?
(It's using lots of stack based code, I should replace some routines too)

Re: The best way to load files with int 10h in a FAT 16 fs

Posted: Sat Sep 11, 2010 7:01 am
by Combuster
How about caching the FAT instead of seeking to it after each data sector? I use that method to load 500k in well under 30 seconds...

Re: The best way to load files with int 10h in a FAT 16 fs

Posted: Sat Sep 11, 2010 8:54 am
by Creature
Here are a couple of things to try (if you haven't done these already):
  • Sequentially read more than one sector whenever possible.
  • On Bochs (if you're using it): don't forget to turn the IPS up to a number appropriate for your OS. When I started out, I used to leave it pretty low and always found that Bochs was slow. Well, of course it was slow, but it was slow because of my stupidity ;).
  • Try a better memcpy/memset (if you're using them). But seeing as you're coding in Assembly, you're probably already using fast routines (unless you're doing an Assembly for-like-loop or something and not MOVS*).
Hope this helps.

Re: The best way to load files with int 10h in a FAT 16 fs

Posted: Sat Sep 11, 2010 3:30 pm
by Karlosoft
[quote="Creature"]Here are a couple of things to try (if you haven't done these already):
  • Sequentially read more than one sector whenever possible.
  • On Bochs (if you're using it): don't forget to turn the IPS up to a number appropriate for your OS. When I started out, I used to leave it pretty low and always found that Bochs was slow. Well, of course it was slow, but it was slow because of my stupidity ;).
  • Try a better memcpy/memset (if you're using them). But seeing as you're coding in Assembly, you're probably already using fast routines (unless you're doing an Assembly for-like-loop or something and not MOVS*).
Hope this helps.[/quote

#0 Thank you.
#1 The problem isn't of the emulator. I tested it on five different computers, more or less powerful
#2 I am loading file in unreal mode, so I work with a C, 16 bit code that uses peek and poke to write a byte on hight memory

@ Combuster: Wow! I'll try