LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-28-2003, 12:17 AM   #16
vanquisher
Member
 
Registered: Aug 2003
Location: Hyderabad, India
Posts: 126

Original Poster
Rep: Reputation: 15

Quote:
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.
 
Old 08-28-2003, 01:19 AM   #17
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
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. 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).
 
Old 08-28-2003, 01:28 AM   #18
vanquisher
Member
 
Registered: Aug 2003
Location: Hyderabad, India
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
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.
 
Old 08-28-2003, 04:13 AM   #19
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
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.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cloning 1 hard disk to smaller hard disk, dd or ghost? fireman949 Linux - Hardware 8 12-23-2012 12:51 AM
Reiser file system / Hard Disk/ Hard Drive Problems Oxyacetylene Linux - Software 4 10-10-2005 02:24 PM
Reclaim disk partition from hard disk installation EStester Linux - Enterprise 2 03-09-2005 11:46 AM
Reclaim disk partition from hard disk installation EStester Linux - General 1 03-09-2005 11:25 AM
Hard Disk question - Making a big hard disk MrAnonym Linux - General 2 09-15-2003 06:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration