Page 1 of 1

[OS]File to memory

Posted: Sat May 08, 2004 1:48 pm
by PJ
Hi

I want to copy file in to memory 0A000:0000(64000bytes) in my OS, OS is in a floppy. I don't know how. Pleas Help me!

Re:[OS]File to memory

Posted: Sat May 08, 2004 9:31 pm
by Brendan
Hi,
PJ wrote: I want to copy file in to memory 0A000:0000(64000bytes) in my OS, OS is in a floppy. I don't know how. Pleas Help me!
When?

If you'd like to load this data during boot you could use BIOS functions to load it into memory (similar to loading your kernel) and then copy it from memory into the video display area when you are ready. I'd be tempted to run length encode the data and decode it straight into video memory once you've switched to 320*200*256 colour mode, and then free the memory it was using after (if necessary).

If you'd like to load this file after the OS is up and running then you may want to write a floppy disk device driver for your OS. This means your kernel will need to support IRQs, DMA, memory management and possibly some form of virtual file system support.


Cheers,

Brendan

Re:[OS]File to memory

Posted: Sun May 09, 2004 2:32 am
by PJ
I am newbe at this read in floppy :(

please small code of this problem, please

I must write this:

_pic: ... <=== ???? <==== I must save pic.pic to 0A000 memory
ret
main
{
pic();
}


please HELP!!

Re:[OS]File to memory

Posted: Sun May 09, 2004 3:29 am
by Pype.Clicker
I suggest you google for the 'Ralf Brown's Interrupt List' ... Memory transfers from the floppy are handled by INT 13h and video mode setting by INT 10h ...

Also get one of our "Small Kernel with Sources" (on the[http://www.osdev.org/osfaq2/]WikiFAQ[/url]) and look how one can use INT13 to read data (or maybe you can find this in a tutorial on BonaFide) ...

if you want to read *a file* and write it in memory, make sure you read and understand the file's format properly (www.wotsit.org) and that you know how the filesystem on the floppy works (FAT12 most likely, which you can find info about on OSRC).

The .:QuickLinkz:. thread should become your friend :P

Relax, and good luck