Page 1 of 2
Ports Serial and Parallel
Posted: Wed Mar 24, 2004 12:25 pm
by Neo
What exactly are these ports? Can the same port be used for different purposes such as mouse,modem etc etc..? if so what exactly does a kernel have to do with regard to these? just keep waiting for data?
Re:Ports Serial and Parallel
Posted: Wed Mar 24, 2004 12:38 pm
by bubach
u should have drivers, if the user has a serial mouse or if a user program needs the ports..
/ Christoffer
Re:Ports Serial and Parallel
Posted: Wed Mar 24, 2004 1:16 pm
by ASHLEY4
Here is a good link if you need info or if you are making a driver.
http://www.beyondlogic.org/
ASHLEY4.
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 2:46 am
by Pype.Clicker
those ports are very low-level bytes transmitters. The kernel will just see bytes going in or out through those ports. If you have a modem connected through a COMx port, for instance, the modem driver will talk with the modem's internal hardware by sending and receiving bytes through COMx.
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 9:07 am
by DennisCGc
Serial and Parallels port are the old ports used to communicate with other devices.
The parallel port works faster than the serial port (aka COM port), because the way to send things is parallel, and a COM port serial

Anyway, a serial port triggers (when selected

) an interrupt.
This interrupt is "fixed", that means the interrupt choice can't be changed.
A parallel port does that too, but I'm not sure whether you can change it or not ::) .
I once created a driver for the Rs232 units, but if they work, I don't know

.
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 1:00 pm
by Neo
Pype.Clicker wrote:
those ports are very low-level bytes transmitters. The kernel will just see bytes going in or out through those ports. If you have a modem connected through a COMx port, for instance, the modem driver will talk with the modem's internal hardware by sending and receiving bytes through COMx.
so does that mean that the kernel routes the data from the ports to the modem driver etc? or is there anything else that the kernel has to do other that just routing the incoming and outgoing data?
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 1:09 pm
by Therx
with serial you may have to deal with CTS, RTS etc.
Pete
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 1:32 pm
by Neo
CTS=? RTS=?
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 1:48 pm
by Candy
Neo wrote:
CTS=? RTS=?
Terminology on serial ports:
CTS = Clear To Send, RTS = Request To Send
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 2:02 pm
by Neo
so what the kernel shoud do is ensure that data arrival and departure is done in an orderly manner? is that right? or is there something more?
(this is begginig to sound monotonous)
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 2:10 pm
by Candy
Neo wrote:
so what the kernel shoud do is ensure that data arrival and departure is done in an orderly manner? is that right? or is there something more?
(this is begginig to sound monotonous)
The very very general function of the kernel is to translate from:
Code: Select all
int fd = open("COM1");
write(fd, "ATDT0031455724119", 17);
write(fd, "Hi mom", 6);
write(fd, "ATH", 3);
close(fd);
to actually doing those things. PS: don't change this code to work, it's a normal phone on that number
The kernel also has somewhat more advanced properties. It might for instance make a general TCP/IP function available, so you can connect to some server and be completely oblivious as to how you do that. If I say I want a socket to
www.mega-tokyo.com it should make that for me.
Also, kernels provide more or less huge function libraries, but only those which you cannot actually do yourself, and those in a protected way. Kernels won't contain zlib or libjpeg or DeCSS or anything like that, they contain hardware interfaces. They also contain software filters that rely purely on those hardware filters (think tcp/ip stack etc), so multiple users can use one hardware device at once.
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 2:40 pm
by Neo
ah so it only has to provide a layer of abstraction to the other apps etc?
well that clears up a few things and makes a lot of others unclear (mostly that which i have not even thought of until now). anyway has anyone here done this stuff in their kernels??
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 2:48 pm
by Candy
Neo wrote:
ah so it only has to provide a layer of abstraction to the other apps etc?
well that clears up a few things and makes a lot of others unclear (mostly that which i have not even thought of until now). anyway has anyone here done this stuff in their kernels??
Yes, it "only" has to provide a layer of abstraction, and in fact it does this:
it converts the raw computer with proprietary interfaces and weird offsets & requirements in a machine for each program, in which each program can do what it likes, pretend there is 4GB (or 128TB for 64bit mode on amds) of memory, be able to communicate with and share with other programs, but not be able to harm them even in those packets they have to interpret themselves, make sure the user that's behind the computer experiences full responsiveness on all programs, even when they do not respond etc.
Why do you think writing an OS is a big job? It's not that you have to do some arcane stuff, it's just that you have to do a really complex normal thing. Billy (with a set of hundreds of professional coders that work for money) could do it, Linus (with half the internet of the 90s) could do it, why shouldn't you? (hint: working together is not bad)
As for those things, I'm choosing a different approach myself (note: if you're not interested in my bs, quit reading now or place a reply, or skip to the next reply.)
I choose to make each subset of kernel activities work tiptop instead of getting all bits working soon, and then getting them working properly. I'm of the opinion that you can get it right the first time. For those things, each module must consider all border cases (yes, that means doublechecking each module dozens of times) and be able to handle them. I believe this is one of the quickest routes to good software.
Also, each structure must be analysed and designed before being implemented properly. That means, sometimes I'm not making any visible progress for months while I'm contemplating and working out an idea I have. Also, being hit by a car severely impacts your typing speed

(that's what I did monday).
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 2:58 pm
by ASHLEY4
My kernel is diffent, So is not a good example,
But i believe that in say 2year there will only be USB connectivety in pc ,So implementing that should come first.
Re:Ports Serial and Parallel
Posted: Thu Mar 25, 2004 5:28 pm
by Tim
Candy wrote:Also, each structure must be analysed and designed before being implemented properly. That means, sometimes I'm not making any visible progress for months while I'm contemplating and working out an idea I have. Also, being hit by a car severely impacts your typing speed

(that's what I did monday).
I couldn't agree more. Look at the OS projects that have failed and those that are still here and going strong. The ones that have failed are the ones where they said, "omfg let's add Windows and Linux and USB and GUI and..." and either nothing got done or it all fell to pieces. The best ones are the authors took the time to do things properly: not adding cool gizmos, but good old-fashioned software engineering.