OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 6:01 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Enumerate PCI Buses
PostPosted: Fri Aug 28, 2015 8:22 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
Sorry, I should have just copy/pasted the text.

I would still get clarification from the instructor of the class. There are two possibilities:

A) You are supposed to write part of an Operating System that communicates with the PCI bus via memory or I/O instructions, or
B) You are supposed to write an application that will run in at least one existing Operating System (Linux or Windows), that asks the OS to provide information about the PCI bus.

There is actually a third option, C) you are supposed to write an application that bypasses the OS and talks directly to the PCI bus, but I think this is highly unlikely, unless this is a class on hacking.

But if I were you, I'd ask which of these is the actual assignment, rather than guess and get it wrong. :)

By the way, I'm pretty sure Windows isn't going to let a user application have direct access to either the PCI I/O ports or the corresponding memory addresses that you would need. So I think it's a moot point.

_________________
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott


Top
 Profile  
 
 Post subject: Re: Enumerate PCI Buses
PostPosted: Sat Aug 29, 2015 6:35 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
I gather that it is supposed to be a binary to run on an existing OS but which bypasses the OS. I gather that what they're trying to say is "write the part of the kernel which accesses the PCI bus, but wrap it up in a binary for an existing OS because we haven't got a kernel to put it in". Thus the code written should be designed to execute in kernel space, and really only needs to push the current OS out of the way as such OS is being used as little more than a program loader.

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: Enumerate PCI Buses
PostPosted: Tue Sep 01, 2015 11:50 am 
Offline
Member
Member

Joined: Sat Nov 21, 2009 5:11 pm
Posts: 852
The assignment seems clear to me. You need to write an user mode program, which bypasses the OS. On linux you can use the iopl or ioperm system calls as root to accomplish this, and on Windows you'll need something like giveio.sys. If you are worried about being preempted in the middle of reading from PCI configuration space, I suggest that you retry at least once and verify that you get the same value both times. Later on, you will port it to kernel space and make it into a proper driver which your user mode layer will invoke.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 56 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