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)
The best way to load files with int 13h in a FAT 16 fs
The best way to load files with int 13h in a FAT 16 fs
Last edited by Karlosoft on Sun Sep 12, 2010 1:32 pm, edited 1 time in total.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: The best way to load files with int 10h in a FAT 16 fs
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
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*).
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Re: The best way to load files with int 10h in a FAT 16 fs
[quote="Creature"]Here are a couple of things to try (if you haven't done these already):
#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
- 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*).
#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