ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Originally posted by Dark_Helmet
I would also assume that filesystems are not rquired, because the concept of a filesystem resides in the domain of the OS. A pure simulation of a hard drive does not know, and does not care about a filesystem. All it does it write data to the blocks/sectors it's told to. How that data is interpreted is up to some other entity.
Thanks for this piece Helmet. I totally forgot about that. So, I'm going for a laaaaaarge array then.
Quote:
EDIT
one of which was a task sheduler. You could have a process that was active, sleeping, of blocked, waiting for IO from a device. The project was to implement various scheduling routines (round-robin, static priority, and dynamic priority)
Well, that sounds like my next assignment in my OS course. Totally freaked me out man.
Thanks for the help guys. I think I finally shaped an idea on how to proceed further. Mine may not be the best approach but I'll post my progress in coming days. Thanks a lot.
Last edited by vanquisher; 08-28-2003 at 12:41 AM.
you could have your program make a file when it starts up called hdd.log or something, and instead of holding the information in proram memory, you could write a function to log the info. My C is rusty so i'll use English instead of C.
Code:
int log(char* data)
{
open the file
append to it
close it
reutrn some value to indicate success or fail (always do error checking)
}
if you are REAALLY lazy..
int read_log()
{
system("echo \"disk read accord..yadda yadda\" >> hdd.log ");
}
int write_log()
{
system("like the above");
}
that way u let the OS handle the opening and closing (and appending).
Originally posted by Robert0380 Logging suggestion:
you could have your program make a file when it starts up called hdd.log or something, and instead of holding the information in proram memory, you could write a function to log the info.
That's what I'm doing. Logging every transaction would be nice. Thanks for the suggestion.
i wish i did comp sci so i could do an operating systems course, or a computer vision course, but i guess i'll just stick to my math. as for the logging just pass the disk an ostream& or as you seem to prefer C a FILE* so that the disk doesnt have to worry about opening/closing files, also a verbosity setting adds a nice touch.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.