Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: wendeloo on February 23, 2012, 01:28:37 PM

Title: special kernel parameter / how to?
Post by: wendeloo on February 23, 2012, 01:28:37 PM
Hi all,

I tried to use tc on a hardware platform, that provides 6 serial ports. I wondered, that I always see 4 serial ports. Hm? Searching something in the inet and found a kernel parameter named "CONFIG_SERIAL_8250_EXTENDED" that will help to have more than 4 serial ports. So far very nice! But how do I get a kernel created with this parameter (by default it seams to be dactivated)? Must I compile a kernel by myself? And if yes: how?!

Many Thanks
Title: Re: special kernel parameter / how to?
Post by: Rich on February 23, 2012, 01:55:27 PM
Hi wendeloo
Looking at the kernel config file, it appears as though you are limited to 4 ports. There is something you can try, but
it's a long shot. There is a boot code called  nr_uarts. You could try   nr_uarts=6   and see if the remaining ports show up.
Title: Re: special kernel parameter / how to?
Post by: gerald_clark on February 23, 2012, 02:55:00 PM
You could also try adding the boot code 8250.nr_uarts=8
Title: Re: special kernel parameter / how to?
Post by: Rich on February 23, 2012, 03:06:39 PM
Hi gerald_clark
Where did you find that syntax?
Title: Re: special kernel parameter / how to?
Post by: gerald_clark on February 23, 2012, 03:11:52 PM
I found that in the kernel docs for kernel 2.6,
and use it for an add-on 4 port serial card under CentOS 5.7.
It may or may not have changed for kernel 3.
Title: Re: special kernel parameter / how to?
Post by: wendeloo on February 24, 2012, 03:27:04 AM
Hi Rich & Gerald,

thank you for the help. Unfortunately the kernel boot parameters you provide don't work (with or without "8250."). I used them in the "menu.lst" in "grub" directory on the end of the "kernel" line (was that right?).

To get more precise I have to complete some informations about my environment: I tested with TC 3.7 (that has kernel 2.6.33-3). Are these parameters valid for this kernel? Or are the chances better with a newer version of TC?

Hope there are more helpful informations.
Title: Re: special kernel parameter / how to?
Post by: Rich on February 24, 2012, 10:47:01 AM
Hi wendeloo
The  nr_uarts  code is listed for both 2.6.33.3 and 3.2, so it should be valid for TC3.x and TC4.x. Based on what
gerald_clark said, his code should be valid under TC3.x. There still the possibility that the kernel config is the
overriding factor here.
Yes, the kernel line was the correct place for the boot code.
Title: Re: special kernel parameter / how to?
Post by: wendeloo on February 24, 2012, 11:04:46 AM
Hi Rich,
thank you very much. Now I see clear what is NOT working for me (the parameter is not working), but what is the way to become more than 4 serial ports working. Do I need a special compilation of the kernel with "CONFIG_SERIAL_8250_EXTENDED" set to "Y"? And if so, what do I need and how it will be done? Are there some How-to-Recompile-the-Tinycore-Kernel documents? And where to find?

I'm very frustrated about this. I never mentioned that a system kernel coult have a limit of serial devices of such a  low level. However, I still hope that someone has an idea that help.

Title: Re: special kernel parameter / how to?
Post by: Rich on February 24, 2012, 04:03:57 PM
Hi wendeloo
According to  http://www.tldp.org/HOWTO/Serial-HOWTO-15.html#ss15.3 (http://www.tldp.org/HOWTO/Serial-HOWTO-15.html#ss15.3)  you should be able to override the
number of ports using one of the two boot codes, depending on whether support is compiled in or supplied
as a module. Try the boot codes again with the value 6. Then check the  /dev  directory. If it worked, you
should find  ttyS0  through  ttyS5  listed.

   [EDIT]: Fixed link.
Title: Re: special kernel parameter / how to?
Post by: wendeloo on February 27, 2012, 06:59:13 AM
Hi Rich,
as described earlier in this thread, the parameters (tried both; with and without "8250.") do not change it as tought > the number of my ttyS's is constant on 4. I also tried different variances of the value (5..16) but everytime the same result: ttyS0..ttyS3 and nothing more.

Has somebody tried this with other results?
Title: Re: special kernel parameter / how to?
Post by: Rich on February 27, 2012, 12:00:38 PM
Hi wendeloo
Where are the ports located? Are they all built into the motherboard or are some on a separate card?
If some are on a separate card, you may just be missing a driver.
Title: Re: special kernel parameter / how to?
Post by: maro on February 28, 2012, 08:52:45 PM
Well, this subject looked like another one for me to take a bit a closer look into the kernel sources. What I found is that both kernel configuration parameters of 'CONFIG_SERIAL_8250_NR_UARTS' and 'CONFIG_SERIAL_8250_RUNTIME_UARTS' need to be considered. As it stands the TC kernel (i.e. 3.0.21 in it's most recent incarnation) uses a value of 4 for each of them.

Reading the respective source file (i.e. 'drivers/tty/serial/8250.c (http://lxr.linux.no/#linux+v3.0.21/drivers/tty/serial/8250.c)'), comparison with some other distributions and some quick tests with a self-compiled kernel allow me now to summarise:
It is therefore my view that the OP requires a differently configured kernel (e.g. via sed -i '/^CONFIG_SERIAL_8250_NR_UARTS=/ s#=4$#=8#' config-3.0.21-tinycore) to have any chance to use more than the current limit of four serial devices.

Some more notes:
Title: Re: special kernel parameter / how to?
Post by: curaga on February 29, 2012, 02:11:35 AM
I wouldn't risk it at this point. Added to the todo list for the next build.
Title: Re: special kernel parameter / how to?
Post by: Astronomy on September 01, 2012, 02:52:13 PM
I'm attempting to gain more than 4 serial ports as well.  Many of the Retail POS Environment PC's that I deal with use 10+ serial ports if not more (every device uses one, the magnetic-stripe reader, cash drawer, Receipt Printer, barcode scanner, keyboards (when they're not standard), touch screen, etc).  I'm loving tinycore but can't seem to recompile my kernel to allow me access to comm 5 and 6 (many IBM touchscreen use these and they're all that matter to me) as this thread suggests.

Thank you all for the continued work on this fine project!
Title: Re: special kernel parameter / how to?
Post by: Rich on September 02, 2012, 01:00:33 AM
Hi Astronomy
Did you read maros post? If you edit the kernel config file and use the following values for example:
Code: [Select]
CONFIG_SERIAL_8250_NR_UARTS=16
CONFIG_SERIAL_8250_RUNTIME_UARTS=8
Recompiling should now yield a kernel that can support 16 comm ports and sets up 8 devices when it boots.
Title: Re: special kernel parameter / how to?
Post by: Astronomy on September 04, 2012, 12:27:26 PM
I tried a few times before posting and intend to continue trying until I am successful at recompiling the kernel. I'm sure it's my mistake in my procedure, I posted more to give another reason why 8 serial ports by default might be a good idea as your user base continues to increase.  Thanks for the reply!  I'm sure I'll get my custom option squared away for my application eventually!
Title: Re: special kernel parameter / how to?
Post by: gerald_clark on September 04, 2012, 02:08:50 PM
Have you tried the boot code "8250.nr_uarts=8" ?