![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2005
Posts: 4
Rep Power: 0
![]() |
Loading a program into memory and executing it...
Hi, I'm writing an OS in assembly (FASM syntax with NASM code snippets) (and hopefully with a C DirectX handler) and need to know how to load a program into memory for execution. I realize that in order to run the program from memory you must call the address. I, however, need to learn how to recognize a file on a disk, or to read certain sectors into memory directly. Either way would work, though the first would obviously be more user friendly (and likely harder to do). Whichever you feel like explaining I am fine with. Thank you.
|
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
This isn't something you learn in a few responses to a post. You need to learn about the file system and how to manipulate it. The tools available to you for this will vary from language to language, from OS to OS, and from implementation to implementation. In the absence of such tools you may choose to get down and dirty. This will require a significant investment in time-to-learn.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Running a program goes far beyond jumping to an address. What do you plan to do for scheduling? How will you handle dynamic linking? What executable formats wll be supported? What filesystem will you use? Writing an OS from scratch is a major undertaking that requires a great deal of knowledge and experience. Perhaps you should read some tutorials and expanations online.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
For the last time: You are not building an OS, you are wasting our time with your ignorant ass questions... Until you do enough research on the subject, please lose the URL to our forums....
__________________
|
|
|
|
|
|
#5 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Look up Bios interrupts 0x13 function 0x2. I'm assuming you have something booting already and need to call a program off of a disk. If you don't have anything booting I can point you somewhere for that too. I wrote something that booted, read a program from disk and reiterated whatever you typed in, out of curiosity. I'll see if I can find that for you.
Also, I'm not sure this is what you're looking for. You may be much further ahead. Please be more specific with your question. If you haven't already, check out Andrew Tanenbaum's book on designing OS's (Can't remember the name off the top of my head nad can't find where I put it)
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Operating Systems: Design and Implementation, Second Edition
A third version of that will appear in 2006. I'll be ordering it as soon as possible, but could also pay Tanenbaum a visit (as he lives 30 mins away) and ask him for a preview ![]()
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#7 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Out of curiosity, is he still in Austin, or is he elsewhere now?
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#8 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
In Austin? No, he lives in The Netherlands (Holland), in Amsterdam to be exact. He teaches at the Free University of Amsterdam (www.vu.nl).
His website there is: http://www.cs.vu.nl/~ast/
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#9 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Heh. Someone told me he was a professor at the University of Texas. I'll have to slap him today.
![]()
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|