guis, I´m new into osdev. I´m trying to develop my os. called " digos " . so. now I have a small problem. I need to load and exec. some file what is the best file format to use ?
.coff .elf ? what is simplest to load and exec ? Please could anyone send to me a source code, cuz I don´t understand just reading a .pdf of .coff struct.
load and exec djgpp coff
Re: load and exec djgpp coff
write those words(cuz, guis) correctly(cause, guys), and use ' instead of `.
ON: If you can load files, it's ok. binary format is so simple, you can run it by loading into memory and jumping to it. source code, i think no one would give you some. but you'll get some explanations, i'm sure
ON: If you can load files, it's ok. binary format is so simple, you can run it by loading into memory and jumping to it. source code, i think no one would give you some. but you'll get some explanations, i'm sure
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: load and exec djgpp coff
I recommend elf, just because its simpler than .exe (assuming your OS is 32-bit) and it makes things like uninitialized data and read only data simple. It has something called program headers, which are basically instructions to the OS that tell it how to load the file. Google for the ELF specification.
As for source code, you'll have to do that on your own like shiner said. With elf it should be pretty simple, all the information you need from the file is in the ELF header and the program headers.
As for source code, you'll have to do that on your own like shiner said. With elf it should be pretty simple, all the information you need from the file is in the ELF header and the program headers.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: load and exec djgpp coff
If reading PDFs (or specifications in general) is the problem, then you should work on that first. If all you want is code then you can just rip other people's open source code (link in my sig). You will need to know how things are supposed to work because it will give you no end of trouble if you don't.
Re: load and exec djgpp coff
How new are you to OS dev? Because before you can load anything you need the drivers for your devices setup. Are you using Protected Mode, or is your OS real mode?
Before you get into Executable files, why don't you try load a .txt file or a .com file, as they have no headers. Once you get that write you will have enough experience to understand those specification documents.
Before you get into Executable files, why don't you try load a .txt file or a .com file, as they have no headers. Once you get that write you will have enough experience to understand those specification documents.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: load and exec djgpp coff
I got pmode with paging my kernel is loaded at 0xC000000 higher half. I got ring 3 protection vm86 mode too with software taskswitching. I have a bitmap memory manager.
I have a fat12 funcions like cd md rd type / cat dir/ls label. rmdir. and a very simple gui. " working on " .
I have a fat12 funcions like cd md rd type / cat dir/ls label. rmdir. and a very simple gui. " working on " .
Re: load and exec djgpp coff
Well then try load a .com file and see if it runs. Remember you either need one that does not use interrupts or one that you have recoded the interrputs. Then the next important thing is to remember you need to wrap the loaded exe in something that will return it to the OS after execution. Like for a .com file test I just add 0xC3 after the last byte of the .com file.
Then you need to find out where the file was loaded and jump there.
Then you need to find out where the file was loaded and jump there.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS