Re: Read/Write bytes directly from hard drive
From: Peter T. Breuer (ptb_at_lab.it.uc3m.es)
Date: Fri, 22 Apr 2005 23:35:36 +0200
asharma <theArjunSharma@gmail.com> wrote:
> We are writing a disk partitioner from scratch. We were not sure how to
> access any byte from the disk, including the master table or any other
> data. Are there any system calls that handle read/write operations?
Sure. read() and write(). Check out lseek() too.
(You asked for that :-).
What could you conceivably not be sure of? Hmm ... it sounds as though
you don't know the basic thing about unix - that everything is a file,
including the "disk". Check out /dev/hda, /dev/sda, etc.