MJR wrote:
- don't compile the serial driver into the kernel and don't load it.
Adam wrote:
Just out of interest, why do you want to not have a ttyS0 ? What are you
trying:
to achieve? if we know that perhaps we can come up with another plan :)
Ted wrote:
Anyway, as Adam says, it would help to know why you want Linux not to know about /dev/ttys0
I still need /dev/ttyS1 to work, since that's where my modem is connected, so disabling serial support altogether isn't really an option.
has it got a dark secret? Crossed the floor of the House to Windows, has it?
Crumbs, NO! If it had strayed to that extent, I would have personally drilled it out of the chassis and incinerated it by now....
The real problem is something of a convoluted story: I started off wanting to run a particular DOS programme using DOSemu. This DOS thing uses a serial port but has to be able to wiggle the RTS line properly. The reason for that is that it gets connected to an RS485 half-duplex system that uses RTS to switch between send and receive. The programme (which was written in Turbo/Power BASIC), when running on a proper DOS PC, writes to, and reads from, the UART's control registers to achieve the correct timing of RTS with respect to the transmitted data. That has all been working nicely for about 8 years on a variety of boxes fitted up with various flavours of DOS.
In trying to make this work on a Linux box, I discovered that the emulation of the serial port by DOSemu is less than perfect. It doesn't faithfully report back the state of the UART's registers, so that, when looking for the transmit shifter to empty in order to know when to switch RTS off, the programme gets the wrong information. Also, there's a problem with the timing relationship between when the transmitted data emanates from the hole on the back of the PC and when the RTS line toggles; I imagine that this is due to latency in Linux's emulation of the port to DOS programmes.
All in all, DOSemu hasn't come up with the goods for this DOS programme of mine, which I HAVE to get working for a client. The DOSemu list has, so far, seen fit not to afford me any help either: when I posted a query there, the response I got was, "What's RTS?", which doesn't exactly fill one with lots of confidence...
This brings me to the query I posted to the ALUG list. I thought that, maybe if I could persuade Linux that what my DOS programme looks on as COM1 (/dev/ttyS0) didn't actually exist, then it wouldn't emulate it; I could then set the relevant things in the DOSemu config file to allow my programme to have direct unhindered access to the UART. Until I can persuade Linux that the port isn't there, I can't do that. If I do, I get an error when DOSemu starts, reporting a conflict between COM1 and standard i/o port. Hence the question: how do I get Linux to ignore a serial port?
I hope that goes some way towards explaining the origin of my question. Sorry it's gone on a bit!
Thanks for your input, chaps!
Cheers,
Gerald.
On 08-Nov-03 Edenyard wrote:
Ted wrote:
Anyway, as Adam says, it would help to know why you want Linux not to know about /dev/ttys0
I still need /dev/ttyS1 to work, since that's where my modem is connected, so disabling serial support altogether isn't really an option.
Thanks for the explanation! I see the point.
Anyway, I'm going to suggest something which may or may not work, but which can at least be easily undone if it doesn't.
1. As root,
mv /dev/ttyS0 /dev/ttyS0.bak
2. reboot.
You may get complaints about /dev/ttyS0 not being there (which is what you wanted anyway ... ), but with luck Linux will not have got it in an arm-lock once all is booted up and dosemu should have it to itself.
There may be a problem arising from the initial hardware probe at the start of boot: if Linux _at that point_ lays claim to the hardware device then there may still be conflicts. I haven't tried the above, so it's only a (possibly uninspired) guess.
If it doesn't work, then of course
mv /dev/ttyS0.bak /dev/ttyS0
and reboot.
Good luck! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 167 1972 Date: 08-Nov-03 Time: 12:29:17 ------------------------------ XFMail ------------------------------
Hi Gerald
Low level IO control - One area that I have been forced into on another project... There are a couple of ways round this that may or may not work. First option. Disable /dev/ttyS1 and redirect DOSemu to use this as COM1: Second option. Recompile the DOS app to run under linux without having to rely on an emulation layer.
Final option. Ports such as ttySx and lpx are registered with the kernel when the driver modules are loaded (or at boot time if they are compiled in). To unregister the IO port without unloading the driver will require a little bit of C coding and a degree of savy with kernel sources. (Unless Ted's suggestion works...)
Regards, Paul.
On Saturday 08 November 2003 11:52 am, Edenyard wrote:
Anyway, as Adam says, it would help to know why you want Linux not to know about /dev/ttys0
I still need /dev/ttyS1 to work, since that's where my modem is connected, so disabling serial support altogether isn't really an option.
On 2003-11-08 11:52:54 +0000 Edenyard mail@edenyard.co.uk wrote:
I still need /dev/ttyS1 to work, since that's where my modem is connected, so disabling serial support altogether isn't really an option.
Feed the serial driver the io address and irq of com2 as com1 or something equally odd, then call it ttyS0. I forget how, sorry, but I'm sure I've done similar things in the past to get an internal ISA modem working.
On 8 Nov 2003, at 20:31, MJ Ray wrote:
On 2003-11-08 11:52:54 +0000 Edenyard mail@edenyard.co.uk wrote:
I still need /dev/ttyS1 to work, since that's where my modem is connected, so disabling serial support altogether isn't really an option.
Feed the serial driver the io address and irq of com2 as com1 or something equally odd, then call it ttyS0. I forget how, sorry, but I'm sure I've done similar things in the past to get an internal ISA modem working.
I just have been watching this thread for the last couple of hours and boy, you guys are making me reliving my past where I tried to get my ISA modem to work (It took me around 30 mins to a hour to get the damn thing to work). Setserial should help you out here.
However, my ISA modem I believe got jumpers on it (would you believe that.. on a 56k modem?). So it is a matter of telling to switch to the right IRQ channel etc. I always fire up minicom in order to see 'AT' working (and manually typing AT to see if it returns).
Modems are the _worse_ hardwares ever invented. Thank god we're moving onto ADSL nowadays.
*shudders*
C
On Sat, Nov 08, 2003 at 08:41:26PM +0000, Craig wrote:
Modems are the _worse_ hardwares ever invented. Thank god we're moving onto ADSL nowadays.
I don't see how you can say modems are "the _worse_ hardwares ever invented" they are about the one thing that doesn't need a driver in any OS (provided they are not a winmodem, but thats a different thing really) I always got around the problem of having to bugger around with jumpers etc. by getting a real external modem, I think that perhaps modems would be best classed as "the best hardware that shows why you really don't want to try doing it on the cheap and save a few quid"
Adam