flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > File I/O without DOS |
Author |
|
OzzY 18 Apr 2004, 16:33
If I'm writing an OS, I can't use DOS interrupt (21h) to work with files, so what interrupt should I do?
Thanks! |
|||
18 Apr 2004, 16:33 |
|
roticv 18 Apr 2004, 16:47
int 13h?
|
|||
18 Apr 2004, 16:47 |
|
OzzY 18 Apr 2004, 16:49
Yes, but How can use it? Give me an example please.
Thanks |
|||
18 Apr 2004, 16:49 |
|
joachim_neu 19 Apr 2004, 14:59
oh, OzzY, I'm coding a filesystem for my OS at the moment, too... Is there in the net somewhere a code from 0x21? If, then we could take it... That would be esier, why should you devolope the wheel again?
|
|||
19 Apr 2004, 14:59 |
|
vid 19 Apr 2004, 18:45
maybe because 21h code is from mico$uck?
ok, i think that coding OS is mainly for learning purpose, and coding filesystem is nice experience. |
|||
19 Apr 2004, 18:45 |
|
OzzY 19 Apr 2004, 20:45
I didn't said that I was codind an OS, but I'd like to learn how to use file I/O without DOS......
I'm just 17 years old, and I've been learning asm for 4 years and general programming for 6 years.... by now I'll stay with asm.... So can anyone help me with some examples on file I/O without DOS?? Thanks |
|||
19 Apr 2004, 20:45 |
|
joachim_neu 21 Apr 2004, 14:43
on wich base do you programm? on win you mustn't use int 0x13, because it runs in PM and doesn't support to use BIOS-Ints...
|
|||
21 Apr 2004, 14:43 |
|
valy 06 May 2004, 10:51
How do you do
google at pizziOS homepage, for instance. He uses ATA commands instead of slower (and real mode) int 13h. Talking directly to the hard disk. But beware : adding some code u do not master is - my experience - dangerous (to debug) And before coding this, make sure u coded the interrupt handling first ! Redirect the external interrupts through the PIC, etc I put it in my (kind of) DOS extender and it's nice : now it often comes back to DOS instead of rebooting/hanging, when buggy. I did not yet implement HDD support. Debugging support is really important IMO. And I plan to *never* use BIOS calls when into PM. Regards _________________ Easier, faster |
|||
06 May 2004, 10:51 |
|
ShortCoder 15 May 2004, 10:27
Probably the best (easiest) route for you to take is to use a FAT format on a floppy drive (MS-DOS formatting a floppy will do this for you), find specs on FAT filesystem (you can find this information VERY readily/easily), then read/write raw sectors on disk using BIOS int 13h as they've said. You want to work with floppy drive because, otherwise, one wrong messup and your data on your drive (OS, files, etc) could be bornked;) which could require a reformat of hard drive and reinstall of OS and files. If you mess up on a floppy, all you have to do is reformat the floppy disk--nothing important lost there.
If you're using FAT filesystem you will be using something pretty "standard" and so could write files to the floppy using normal means and then read them using your raw sector-reading program or else write them that way and read them with "standard" programs. Of course, you could make your own filesystem but then nothing else will be able to read anything you write to it. (Okay, technically there is a way around this but it involves making your own device driver) Okay, once you have gotten this to work satisfactorily, you probably want to read up on the boot sector of the hard drive and master boot record and boot loaders and partitions. Then, if you're really brave, try it on your hard disk but make sure to back up anything important first of all because one wrong move could render it unreadable;). |
|||
15 May 2004, 10:27 |
|
Gomer73 02 Jun 2004, 05:43
Here is a sample boot sector code.
I did some major documentation because I wanted it to be a reference for the boot sector. It automatically creates the the FATs and Directory structure. Unfortunately because the program size is variable the fat is just set to a big size and is not variable. It'll show you how to do some floppy reads. For Bogdan, I updated your code so that it will read a track at a time instead of a sector at a time. I'm not using this code, so I left a lot of junk in there, a lot of it using some sol OS stuff. Didn't feel like modifying it to get it working for the post. If it is of value to anybody, great. ...Gomer73
|
|||||||||||
02 Jun 2004, 05:43 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.