OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 8:01 am

All times are UTC - 6 hours




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 Post subject: Drivers: A system where the OS invokes drivers can be true?
PostPosted: Thu Jun 10, 2010 6:44 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
Can this be possible or NOT. I just think, maybe somebody can correct me
and maybe they can share some useful experience here. I’ve been reading
the following OSDev.org tutorial: IDE, Detecting an IDE drive.

Now this shows how you can write an IDE driver, and do a lot more.
It includes a function for CD-ROM driver ejection:

====================================================
void ide_atapi_eject(unsigned char drive) {};
====================================================

But I am wondering if we would compile this driver to a *.sys file (like in Windows®),
and then install the *.sys for the specific CD-ROM driver.

If I then would right-click the CD-driver from My computer and select
Eject, would it be possible that Windows® OS (or any other OS) is invoking
the ide_atapi_eject() function?

Thanks!


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 7:17 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
I'm seeing a pattern here:
1: This place is about hobby OS development, not writing drivers for Windoze. Go to MSDN
2: Use code tags
3: You've violated and pointed at each of the related forum rules in your previous (all two of them!) posts.

Are you a troll? At least you behave as if you don't want to be taken seriously.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 7:21 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
Combuster wrote:
I'm seeing a pattern here:
1: This place is about hobby OS development, not writing drivers for Windoze. Go to MSDN
2: Use code tags
3: You've violated each of the related forum rules in your previous two(!) posts.

Are you a troll?


I am sorry. I just wanted to ask a question,
this is NOT about Windows, I stated there and any other OS,
I want to know how OS and driver files communicate and then
communicate with Hardware.

If I click Eject then something is happening.

haha, MSDN, I've been a member there for many years...now...
their forums is funny sometimes, because once a OS question
appears they suggest the OP go to a Linux like forum.


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 7:33 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
AFAIK on modern Operating Systems (Not all Operating Systems, but some) today,
I think, the manufacturer writes the driver for their device (or hardware part), the
driver is then shipped in form of file.

Now the actual Question is whether
the OS invokes a function like this one: void ide_atapi_eject(unsigned char drive) {};

Basically, does the actual driver file work as a sort of library which shares functions
like the above one and probably other?


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 7:56 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
OK, fine. I'll add more details.

If I go in any OS and I right-click the CD icon and I select
"eject" and the CD AUDIO Door will open, so it works. But
what about the secrete behinde this, how does this really
occur, thats what I want to know.

I mean I bet that each CD-reader or DVD-reader has their
own addresses and memory addresses and ports.

So to invoke a function that uses the port address
to send a signal to the CD-reader door and suddenly
it will eject (open), but how does it work.

I haven't been able to find the actual answer, therefore
I decided to ask here, since this deals with OS development
and probably writing a kernel which can talk to the nort-and-
south bridge is an important task, right??


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:13 am 
Offline
Member
Member

Joined: Fri Aug 01, 2008 7:52 am
Posts: 248
Developer wrote:
AFAIK on modern Operating Systems (Not all Operating Systems, but some) today,
I think, the manufacturer writes the driver for their device (or hardware part), the
driver is then shipped in form of file.

Now the actual Question is whether
the OS invokes a function like this one: void ide_atapi_eject(unsigned char drive) {};

Basically, does the actual driver file work as a sort of library which shares functions
like the above one and probably other?

No, it's a binary coded Visual Basic script... :roll:
To give you an answer, a "driver file" is executable code in a form or another. AFAIK, linux and some hobby OSes use ELF for modules, which happen to coincide with your "driver files". Windows... doesn't deserve to be taken into discussion, to be honest.
Oh, and I think you should read again (at least twice) Combuster's post ;).

EDIT: this was written before Developer's last post. I'll let someone else explain him how electrons travel through CPU and all those things :P.
LE: forgot to mention the complex system that transfers electrical energy into a rotation movement and then a linear movement, used to open the drive's "Door".


Last edited by eddyb on Thu Jun 10, 2010 8:20 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:17 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
eddyb wrote:

No, it's a binary coded Visual Basic script... :roll:


So you mean everything is made in VBS and then
they use an interpreter for it.


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:23 am 
Offline
Member
Member

Joined: Thu Mar 25, 2010 11:26 pm
Posts: 1801
Location: Melbourne, Australia
I don't buy this. You're kidding right ?

_________________
If a trainstation is where trains stop, what is a workstation ?


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:26 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
gerryg400 wrote:
I don't buy this. You're kidding right ?


Yes with the last post reply above. However, I am NOT kidding regarding
my question of how a OS ejects the actual CD/DVD audio door throught
the physical hardware.

Thanks for your reply!


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:33 am 
Offline
Member
Member

Joined: Fri Aug 01, 2008 7:52 am
Posts: 248
Oh, brother...
Did any of you read the lines under the VBS crap?
Anyway, this will help you :mrgreen:.


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:39 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
eddyb wrote:
Oh, brother...
Did any of you read the lines under the VBS crap?
Anyway, this will help you :mrgreen:.


Finally somebody that understands, Eddyb, thanks for your reply.
The ENTIRE topic is about how can a OS and hardware communicate?

AFAIK, the OS talks with north-and-south bridge and then
can through memory addresses invoke (or something) and
collect driver details..etc.

AFAIK, once we pass BIOS, and MBR and our booloader loads in the
needed stuff and then invokes our main(); for our C kernel, then
the reset hangs on the OS, AFAIK, the OS acts "almost" (keep in mind ALMOST)
as an BIOS, because its left on its own.

EDIT: I did NOT see that it was you....hahahahaha!!! Funyy! Man! :D


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:45 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
Please, randomly posting smart-sounding terms gives you absolutely no credit. Not reading what has been said too.

If you know how you can call functions in other files, you know the answer. Get lost.
If you don't know how you can call functions in other files, you are a programming n00b and absolutely unsuited for OS development. Get lost.
If you want to get answers fed by the spoon, you are asking for trouble. Get lost before someone shoots you.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: Drivers: A system where the OS invokes drivers can be tr
PostPosted: Thu Jun 10, 2010 8:47 am 
Offline

Joined: Mon Jun 07, 2010 7:45 am
Posts: 10
Anyway, I am sorry, I will probably ask a similar question on another Forum.
I thought that this was the place where software engineers and software
developers were and that I could find them here. I also thought that the
pros here could understand my question and then give me important details.
Anyway, guys thank you for taking your TIME. Bye, have a great time and
a nice day......Thanks! :D :D :D =D> :mrgreen:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot], Octocontrabass, scippie and 150 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group