flat assembler
Message board for the users of flat assembler.

Index > OS Construction > How I can write a driver to access my hd from my own os?

Author
Thread Post new topic Reply to topic
MarcoAlves



Joined: 09 Jun 2006
Posts: 30
MarcoAlves
Hi.

I'm trying to write from scratch a driver to access my hd from my own os but I have no idea where to start.

Can someone help me?
Post 26 Jun 2006, 15:23
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Post 26 Jun 2006, 16:27
View user's profile Send private message Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
Quote:

How I can write a driver to access my hd from my own os?

great project. You may wish to begin with a decision on access to a particular type of mass storage device:

serial attached scsi (sas) and scsi: http://t10.org/
usb: http://www.usb.org/home
ata: http://t13.org/
firewire: http://standards.ieee.org/
sata: http://www.ata-atapi.com/sata.htm

Hope these may be helpful. Once you have accessed the hard drive/cdrom or thumb drive, then, you may wish to partition that storage device, and for that, I suggest, following Bogdan's advice, http://www.oby.ro/os/
the excellent tool created by Mikhail Ranish,
http://www.ranish.com/part/
For implementation of accessing atapi/ide hard disk, SOL offers a helpful illustration:

http://www.oby.ro/os/files/sol_os_2006_06_21_bin.zip
http://www.oby.ro/os/files/sol_os_2006_06_21_src.zip

Here's a link to Christoffer's forum, also with lots of helpful documentation, as well as many useful links to other "hobby" operating systems, created by folks, like you!
http://bos.asmhackers.net/forum/index.php
Smile
Post 27 Jun 2006, 10:14
View user's profile Send private message Reply with quote
MarcoAlves



Joined: 09 Jun 2006
Posts: 30
MarcoAlves
tom tobias. Thx a lot for the useful links. But I also want to write a partition manager before the driver. This is the sequence of steps I will do:
1)Write a partition Manager
2)Write a driver for to access my hd from my os
3)Write a file system

Do you know how I can write a partition manager?

Thx a lot
Post 27 Jun 2006, 12:53
View user's profile Send private message Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
Quote:

write a partition manager

Bogdan introduced me to XOSL, which works well, unless one uses xp, I have failed on numerous occasions attempting to run both XP and SOL together on the same IDE drive,
http://en.wikipedia.org/wiki/XOSL
most recently this past weekend, when I spent two days trying in futility to get xp and SOL on the same SATA disk working with XOSL. I do not have this problem on other computers with win98se.
Sorry, I have no experience writing any partition manager, but suppose this will be a HUGE task, at least it would be for me. I am so oblivious, I would have supposed the FIRST step (and not third, as in your list) in your project would be to establish a file specification document....
Smile
Post 29 Jun 2006, 03:13
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
tom tobias wrote:
most recently this past weekend, when I spent two days trying in futility to get xp and SOL on the same SATA disk working with XOSL. I do not have this problem on other computers with win98se.
Have you tried "virtual machines" to emulate one of these OSes. I have no problems at all with this, and with the right settings, the speed is interestingly good. Smile

tom tobias wrote:
I am so oblivious, I would have supposed the FIRST step (and not third, as in your list) in your project would be to establish a file specification document....
Depends on the person. I also like to document things before writing them, but sometimes I feel writing them first can be better, especially when I need to know exactly the implementation.
Post 03 Jul 2006, 18:52
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
the first document on hdd driver development is ata-atapi spec (and errata), i think. all other is a supplementary reading.
to make a partition manager is not an easy task to start with. i'm writing the driver now, too. and a partition manager Smile)
imho, it's better to write a driver first, and then a partition manager based on it. you can use low-level procedures from the driver in your partition manager. in this case you don't need to write the same code twice.
to start coding your PM, you should know in details how disks are partitioned. mbr, partition tables, etc. try to read How Stuff Works articles on the topic. (http://www.ata-atapi.com/hiwmbr.htm). also take a look at actual disk partitions (WinHex under Win32 can help you) with various file systems, disassemple some mbrs and boot sectors... this will help a lot.
Post 07 Jul 2006, 09:53
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
yea, and one more thing... as for me, i gave up the idea of writing my own file system. this is no good. it's better to build your os on one of existing file systems. fat is the easiest to start with.
Post 07 Jul 2006, 09:57
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu
Insides SOL OS you will find a FDISK Test application (under Hardware Tests Menu)

This application does exactly that: "partition manager" .

Of course for safety reasons it will only READ partitions and not write them.

Partition manager (actualy partition reader and enumerator) is the first step for implmenting a filesystem layer in your OS but it is NOT the first steep for a HDD driver

The first step for a HDD driver is the ATA (HDD) or ATAPI(CD/DVD ROM) Specifications...
Post 07 Jul 2006, 11:29
View user's profile Send private message Visit poster's website Reply with quote
MarcoAlves



Joined: 09 Jun 2006
Posts: 30
MarcoAlves
thx for all replies.
Post 07 Jul 2006, 12:05
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.