Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 22nd, 2005, 5:21 PM   #1
Datalisk
Newbie
 
Join Date: Oct 2005
Posts: 4
Rep Power: 0 Datalisk is on a distinguished road
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.
Datalisk is offline   Reply With Quote
Old Oct 22nd, 2005, 7:02 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Oct 22nd, 2005, 10:09 PM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
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
Dameon is offline   Reply With Quote
Old Oct 22nd, 2005, 10:19 PM   #4
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
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....
__________________

tempest is offline   Reply With Quote
Old Oct 23rd, 2005, 12:29 PM   #5
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Oct 23rd, 2005, 7:13 PM   #6
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
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
nnxion is offline   Reply With Quote
Old Oct 23rd, 2005, 9:00 PM   #7
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Oct 24th, 2005, 4:28 AM   #8
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
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
nnxion is offline   Reply With Quote
Old Oct 24th, 2005, 5:56 AM   #9
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:03 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC