flat assembler
Message board for the users of flat assembler.
Index
> Main > Files open an work with... |
Author |
|
joachim_neu 30 Dec 2003, 14:44
hello,
how do you open a file with the name "XYZ.XYZ" and work with it, without DOS-Interrupts??? Joachim Neu |
|||
30 Dec 2003, 14:44 |
|
pelaillo 30 Dec 2003, 16:05
Hi, joachim_neu
In Linux: Code: sys_read = 0x3 sys_write = 0x4 sys_open = 0x5 sys_close = 0x6 ; section data io_bytes dd ? filesize dd ? filename db "XYZ.XYZ",0 buffer rb 10000h ; This must hold the readed bytes ; section code mov eax,sys_open mov ebx,filename mov ecx,O_RDONLY xor edx,edx int 0x80 mov ebx,eax mov eax,sys_read mov ecx,buffer mov edx,[filesize] int 0x80 mov eax,sys_close int 0x80 In Windows: Code: api CreateFile,filename,GENERIC_READ,0,NULL,\ OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL test eax,eax jz error_read mov ebx,eax api GetFileSize,ebx,NULL mov [filesize],eax ; to read it all api ReadFile,ebx,buffer,[filesize],io_bytes,NULL test eax,eax jz error_read api CloseHandle,ebx |
|||
30 Dec 2003, 16:05 |
|
vid 30 Dec 2003, 19:11
if you meant how to do it yourself, without using any kind of library, then answer is: if you don't know how better dont try it. There are too many things you need to know
|
|||
30 Dec 2003, 19:11 |
|
comrade 30 Dec 2003, 23:02
To do it directly, you need to know inner working of a particular filesystem and how to work directly with hard drives.
|
|||
30 Dec 2003, 23:02 |
|
joachim_neu 07 Jan 2004, 13:07
hello,
Oh... That's all very difficult... And I think I should lern ASM better, before I code an OS... What have you got to do without 32Bit??? And what must you do, if you want to change in 32Bit-Mode??? Without some libarys or DOS-Interrupts... thanks for your answers... JOACHIM NEU |
|||
07 Jan 2004, 13:07 |
|
vid 07 Jan 2004, 19:21
you should get some protected mode specification (not DPMI spec or VCPI spec, forget about these), also few protected mode coding tutorials (learning from specification is not much fun, i know it), and of course many OS coding tutorials which will come handly when you know something about protected mode. I am not right one to point out best, but there are many who coded OS on this forum.
Also dont forget to ask people who coded MenuetOS to aid you few good tuts. |
|||
07 Jan 2004, 19:21 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.