Page 1 of 1

Filesystem

Posted: Sun Nov 16, 2008 12:41 pm
by sadisoft
Is there any short example code to get bytes of a file, that is on the os image, because i want to draw a image from the bytes?

Re: Filesystem

Posted: Sun Nov 16, 2008 1:19 pm
by furryfreak
are you wanting to make your own file system, or use an existing one?

if you want to use an existing one, check out the grub2 source code.

Re: Filesystem

Posted: Mon Nov 17, 2008 8:27 am
by sadisoft
thanks, i want to use existing

Re: Filesystem

Posted: Mon Nov 17, 2008 11:54 am
by sadisoft
This is a very complex filesystem. Is there any easier example to get bytes from a file, which is on the os cd?

Re: Filesystem

Posted: Mon Nov 17, 2008 3:50 pm
by jgraef
Hi,

You could put the image in a reserved sector on disk. But you don't want to!
You can't just start writing an OS with the GUI. You first need a stable system (Kernel, VFS, etc).
I'm developing my OS for over a year now and there is still no GUI. There isn't a shell either. You really first need the essential things like drivers and so on.

If you just want to write a GUI this is the wrong forum for you (At least I hope so).

Re: Filesystem

Posted: Tue Nov 18, 2008 11:24 am
by furryfreak
a good file system to start with would be FAT12. It's a very crappy file system technically speaking, but its easy(ish) to work with, especially if your using floppy disks/.img's, as floppy's tend to be formatted as FAT12/16.

Here's a link to a FAT12 tutorial http://www.brokenthorn.com/Resources/OSDev6.html, many of the other tutorials on that site are also good as a starting point.

As for drawing an image to screen, search for the VGA and VBA standards, you should be able to find the pdf's on the VESA website. VGA is simple, limited, only any good for real-mode, and supported by just about every x86 BIOS. VBA on the other hand is much more flexible and works in protected mode, however its quite a bit more complicated. It should be relatively easy to draw a .bmp file, I wouldn't try any compressed file formats until you've got a bitmap on screen.

this wikipedia page should shed some light on the bitmap format: http://en.wikipedia.org/wiki/Windows_bitmap