[OS]File to memory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PJ

[OS]File to memory

Post 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!
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:[OS]File to memory

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
PJ

Re:[OS]File to memory

Post 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!!
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:[OS]File to memory

Post 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
Post Reply