Help with file I/O

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
KieranFoot

Help with file I/O

Post by KieranFoot »

Help!!!

Please can somebody provide a tutorial in file I/O.
My os is coded in pure ASM and uses fat12.

Please can someone provide me with some examples???
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:Help with file I/O

Post by Pype.Clicker »

what exactly do you need ? what do you already have ?

For instance, are you trying to "read one file's data using the BIOS int 13h interrupt", or "lookup for a file in a directory ?", etc.

There are many "layers" in file I/O. Are you trying to access a disk device in order to read blocks or trying to know which block is part of which file ?
KieranFoot

Re:Help with file I/O

Post by KieranFoot »

Well I need all of that stuff scince i have none at the moment. ;D
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:Help with file I/O

Post by Pype.Clicker »

i suggest you get a look at Operating System Resource Center (.:QuickLinkz:. again ;) ), where you'd be able to find everything: FAT structure and possibly tutorials&code samples, floppy drive behaviour, ATA hard disk commands, etc.
KieranFoot

Re:Help with file I/O

Post by KieranFoot »

All of these site contain c source not asm. One of the aims for my os is that it is to be written in pure 16/32 bit ASM
BI lazy

Re:Help with file I/O

Post by BI lazy »

@Kieran: STFW!!!!

Further, I suggest, you study the c sources and extract the algorithms. For you seem to be a keen assembler-programmer * you can easily transform the algorithms into magnificient asm-code.

And for you are a programmer you know: not the programming language is the essence of a running program *but* the sum of all the algorithms which are keeping it running - be it an os be it an application using os services.

You of course understand that I 'm not going to accept further moaning about "c-sources and not asm sources"

Stay safe

*: Oh, somebody who has guts to do an os in asm needs to be a very keen asm programmer.
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:Help with file I/O

Post by Pype.Clicker »

KieranFoot wrote: All of these site contain c source not asm. One of the aims for my os is that it is to be written in pure 16/32 bit ASM
I used to program a SoundBlaster module player in 100% asm by studying a pascal implementation in a book... C/pascal code will be easier to follow as a reference as it focuses on *what* has to be done rather than *how* it is done... It will also have cleaner data structures than any ASM code.

What i suggest to you is to convert that code in some kind of "structurograms" or whatever box-and-arrows you're used with and then converting boxes into ASM code.
KieranFoot

Re:Help with file I/O

Post by KieranFoot »

Cheers guys, sorry for moaning, iot's just that i dont really understand c++ and how it works to get at the needed alogrithyms!!! ;D

Is my spelling O.K :P
Tim

Re:Help with file I/O

Post by Tim »

Right, well the concepts needed to understand how C++ are at the bottom end of what you need to know to succeed in OS development. Consider that a useful piece of learning to have before you get deep into design. I assume you're designing everything before you begin writing any code, right?
BI lazy

Re:Help with file I/O

Post by BI lazy »

You wanna do an operating system?

You wanna program?

Learn using language in the correct way, hm? It's *very* importing for programming.
BI lazy

Re:Help with file I/O

Post by BI lazy »

not importing, but *important*

damn, one shan't hold rants if tired and drowsy *yawn*
Post Reply