Linux-Development-Sys Digest #593, Volume #8 Wed, 28 Mar 01 07:13:06 EST Contents: Re: syscall from within kernel (Mikael Pettersson) computer input/output devices (carla) problem with put_user for char device (V2.2.17 kernel). (Soren) asm: can't figure out how to use 'jc' ? ("Jonathan H Lundquist") Re: can't figure out how to use 'jc' ? ("Jonathan H Lundquist") Re: linux driver wtih STREAMS system (Juergen Heinzl) Slackware runs on Yopy, the first Linux PDA in the world. ("jina") Re: LILO (John in SD) uart (Josef Allen) Module debugging ("S. Miller") Re: 0-order allocation failed on 2.4.2 ("David Gray") Re: problem with put_user for char device (V2.2.17 kernel). (Kasper Dupont) Re: Processor ID (Jonadab the Unsightly One) Using DMA hardware from user space (David Florez) Re: Using DMA hardware from user space (Arne Driescher) 64 bit I/O for RedHat EE for Oracle8i (David YEUNG) Parallel Port (Jan Pietrusky) ---------------------------------------------------------------------------- Subject: Re: syscall from within kernel From: [EMAIL PROTECTED] (Mikael Pettersson) Date: 27 Mar 2001 21:25:07 +0100 In article <[EMAIL PROTECTED]>, Dave Grothe <[EMAIL PROTECTED]> wrote: >-=-=-=-=-=- > >In 2.4.2, some code at the end of <asm/unistd.h> would lead one to think >that certain system calls, such as open, close, read, write, can be >called from within the kernel. > >I tried something similar with "mknod" and found that it failed to >understand that the "filename" parameter was a kernel address rather >than a user space address. > >Does anyone know what the intent is concerning the use of system calls >from within the kernel itself? Is it intended that it is not to be >done? Or is it intended to be OK and there is just a bug that needs >fixing? mm_segment_t old_fs; int ret; old_fs = get_fs(); set_fs(KERNEL_DS); ret = <syscall with pointer parameters>; set_fs(old_fs); if (ret) { do something; } else { do something else; } Cheers, /Mikael -- Mikael Pettersson ([EMAIL PROTECTED]) Computing Science Department, Uppsala University ------------------------------ From: carla <[EMAIL PROTECTED]> Subject: computer input/output devices Date: Tue, 27 Mar 2001 19:30:11 -0000 I would like to know the definition and history of the different input /output devices of the computer -- Posted via CNET Help.com http://www.help.com/ ------------------------------ From: Soren <[EMAIL PROTECTED]> Subject: problem with put_user for char device (V2.2.17 kernel). Date: Tue, 27 Mar 2001 19:30:36 -0000 Greetings, I am trying to write a *very* simple character device driver (straight out of a book) and am getting an error that I cannot fix and do not understand. Any help is appreciated. The pertinent details: Mandrake 7.2 (kernel 2.2.17) in the driver: static char * Message_Ptr; static char Message_buf[100]; static ssize_t device_read ( struct file * file, char * buffer, size_t length, loff_t * offset ) { <snip> while ( length && * Message_Ptr ) { put_user( *(Message_Ptr), buffer); Message_Ptr++; buffer++; length--; } the problem is that the module won't load with a report of : unresolved symbol __put_user_X which implies that the size of the target (ptr) is neither 1, 2, nor 4 bytes (!?) However, using copy_to_user works very well. what am I missing? If I try to force it (via hacking the macro) to use put_user_1 it returns garbage. Help? -- Posted via CNET Help.com http://www.help.com/ ------------------------------ From: "Jonathan H Lundquist" <[EMAIL PROTECTED]> Subject: asm: can't figure out how to use 'jc' ? Date: Tue, 27 Mar 2001 11:59:17 -0800 I'm new to Linux, GCC, and AT&T asm syntax, all of which is frustrating me <g>. I'd very much appreciate help with the following, which is something I am trying to port from WinTel C++ inline assembly. The problem is with the target of the jump carry. On compiling, I get "undefined reference to repeat" at the jump carry line. I've tried every form of this I can think of. Thanks for any help. inline void Xlock(volatile unsigned char* bLock) { top: __asm__ __volatile__ ( "lock bts $0, %0\n jc repeat" :"=a" (*(int*)bLock) :"a" (*(int*)bLock)); return; repeat: TRACE1("Spinning %08x\n", bLock); sched_yield(); goto top; } ------------------------------ From: "Jonathan H Lundquist" <[EMAIL PROTECTED]> Subject: Re: can't figure out how to use 'jc' ? Date: Tue, 27 Mar 2001 12:02:54 -0800 BTW: My WinTel function looks like this, I'm not sure if I've even got the bts stuff correct in this AT&T format..., so any other comments would be appreciated. inline void __declspec(naked) __fastcall Xlock(volatile unsigned char* bLock) { top: __asm lock bts word ptr[ecx], 0 __asm jc short repeat __asm ret repeat: __asm push ecx TRACE1("Spinning %08x\n", bLock); Sleep(1); __asm pop ecx __asm jmp short top } "Jonathan H Lundquist" <[EMAIL PROTECTED]> wrote in message news:Zh6w6.1396$[EMAIL PROTECTED]... > I'm new to Linux, GCC, and AT&T asm syntax, all of which is frustrating me > <g>. I'd very much appreciate help with the following, which is something I > am trying to port from WinTel C++ inline assembly. The problem is with the > target of the jump carry. On compiling, I get "undefined reference to > repeat" at the jump carry line. I've tried every form of this I can think > of. Thanks for any help. > > inline void Xlock(volatile unsigned char* bLock) > { > top: > __asm__ __volatile__ ( > "lock bts $0, %0\n > jc repeat" > :"=a" (*(int*)bLock) > :"a" (*(int*)bLock)); > > return; > > repeat: > TRACE1("Spinning %08x\n", bLock); > sched_yield(); > goto top; > } > > > ------------------------------ From: [EMAIL PROTECTED] (Juergen Heinzl) Subject: Re: linux driver wtih STREAMS system Date: Tue, 27 Mar 2001 21:39:59 GMT In article <[EMAIL PROTECTED]>, Andrew Kondakov wrote: >Hello. > >I try to develop linux driver with STREAMS system installed in kernel. >I have received STREAMS from www.gcom.com (LiS). >This way I can re-use my Solaris driver in Linux. >Has somebody tried to develop something like this? >And what disadvantages and problems will come using such non-ordinary >Linux driver? [-] STREAMS support, or the lack of, has been an issue for years. AFAICT it boils down to "considered too slow", something which might be taken as a sign a few people ought to read Stevens' network bibles again, to start with. Say not in the forseeable future, so your drivers are bound to, more or less, require a custom kernel -- a maintenance nightmare. If you write drivers for a specific piece of hard- and software combination, some closed shut appliance, then maybe, but else don't expect much acceptance. Ta', Juergen -- \ Real name : Juergen Heinzl \ no flames / \ EMail Private : [EMAIL PROTECTED] \ send money instead / ------------------------------ From: "jina" <[EMAIL PROTECTED]> Subject: Slackware runs on Yopy, the first Linux PDA in the world. Date: Wed, 28 Mar 2001 11:58:47 +0900 Dear Sir or Ma'am We, at G.Mate Inc., have developed and manufactured PDA based on Embedded Linux OS since its foundation in November of 1998. The people from all of world paid great attention to our world-first multimedia PDA by the name of YOPY when it was exhibited in the CeBIT Show in Hanover of Germany and in the Comdex/Fall in Las Vegas of USA in February and November of 2000 respectively. Ever since we have been devoting all our energy to developing PDA integrating either Cellular module or Bluetooth module and to the mobile communication IMT-2000 PDA business for the next generation In order to make Linux supporters and developers enthusiastically participate in enlarging and developing the environment of Linux and applied programs, we have started to sell the development kit of multimedia PDA based on Linux from January 21, 2001 through our website (www.gmate.co.kr) and many people of the world have shown their interests and encouragement generously. The YDK product includes YOPY hardware, software environment, Linux Source Package Solution, etc. By sharing with you solutions and knowledge related to Embedded Linux PDA we have developed so far, we expect that there would be absolutely outstanding realization of desirable Linux environment and development of invaluable Linux PDA in the near future. ------------------------------ From: John in SD <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.apps Subject: Re: LILO Reply-To: [EMAIL PROTECTED] Date: Wed, 28 Mar 2001 04:06:59 GMT LILO stores the BIOS device code and sector address of each kernel sector that it will load. On pure IDE systems, most BIOSs assign device codes in ascending order. Likewise on pure SCSI systems. There are various methods used on mixed IDE/ SCSI systems. In 'lilo.conf', you can tell LILO the exact correspondence between your disks and BIOS device codes. Use: disk=/dev/hda bios=0x80 disk=/dev/sda bios=0x81 etc. The source distribution of LILO comes with two diagnostics which will help you to sort this out: lilo -T geom will work on many systems. (LILO 21.6 and later) "make floppy" in the LILO source directory; then boot the floppy disk, will work on ALL systems, and will tell you the correspondence between your drives and BIOS codes. --John On Tue, 27 Mar 2001 20:04:13 -0500, [EMAIL PROTECTED] wrote: >hi, > >i hv this rather perculiar problem wif LILO that >i first noticed when i recompiled my kernel (coz it >does a LILO reconfig later). > >i hv a scsi hd and a primary ide hd.. but booting >is done via scsi not the ide hd. the ide hd was >actually added later. now LILO complains that >"Warning .. sda3 is not the first disk.." >and when i reboot.. LILO fails to load and it >actually stops at "LI". > >so wat i did was to disable the primary ide controller >via bios and reboot via another boot disk/cdrom then >mount up this scsi hd and do a LILO once more. this time >of coz.. there wasnt that warning again and after that >i reenabled the primary ide controller. everything >now works fine. > >well i was wondering if there is a simpler work around >coz i need to recompile my kernel pretty often. > >thanks. > >jason LILO version 21.7 (24-Feb-2001) source at http://www.ibiblio.org/pub/Linux/system/boot/lilo patches to -2 at ftp://brun.dyndns.org/pub/linux/lilo ------------------------------ From: Josef Allen <[EMAIL PROTECTED]> Subject: uart Date: Tue, 27 Mar 2001 23:01:27 -0500 Does anyone Know how to directly program the uart using inb() and outb functions. Josef D. Allen ------------------------------ From: "S. Miller" <[EMAIL PROTECTED]> Subject: Module debugging Date: Wed, 28 Mar 2001 04:35:24 GMT Hi, I'm writing a usb driver for a video sensor my company will be releasing later this Spring. It currently gets a segv in the initialization sequence. When this happens the module is left loaded but owned by "initialization". It refuses to be rmmoded (module busy) and of course I can't do another insmod. Is there any way short of a reboot to clear this? I don't have another machine to do remote debugging, so I'm having to hunt it down with printk's. I'm running kernel 2.2.18. I don't have newsgroup access through the firewall at work, so please do a reply all (I bcc'd my work address) if you have the answer. Thanks, Steve -- Madness takes its toll. Please have exact change Steve Miller (602) 485-2014 Staff Engineer STMicroelectronics, Inc. ------------------------------ From: "David Gray" <[EMAIL PROTECTED]> Subject: Re: 0-order allocation failed on 2.4.2 Date: Tue, 27 Mar 2001 23:17:07 -0800 This means the kernel wasn't able to allocate any pages to satisfy your request - that is, you ran out of kernel memory. The 0 probably comes from get_zeroed_page() which calls alloc_pages() with an order value of 0, this in turn eventually gets to __alloc_pages() which tries really hard to allocate what you asked for in terms of a working set of pages but can't. It looks like the swapper is woken up in order to swap out whatever it can to make memory available, in your case, that didn't work either. How much RAM and how much swap do you have? David Gray "Ed Clarke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > I just got 660 messages: > > __alloc_pages: 0-order allocation failed. > > on 2.4.2. I'm trying to download the source right now but in the > mean time, should I be panicing? This showed up right after I > finished catenating a bunch of files to make a single 2941092680 > byte file. At least this time it didn't trash the system completely. > > This showed up in dmesg and /var/log/messages, not in the cat command. ------------------------------ From: Kasper Dupont <[EMAIL PROTECTED]> Subject: Re: problem with put_user for char device (V2.2.17 kernel). Date: Wed, 28 Mar 2001 07:20:33 +0000 Soren wrote: > > Greetings, > > I am trying to write a *very* simple character device driver (straight out > of a book) and am getting an error that I cannot fix and do not > understand. Any help is appreciated. > > The pertinent details: > Mandrake 7.2 (kernel 2.2.17) > > in the driver: > > static char * Message_Ptr; > static char Message_buf[100]; > > static ssize_t device_read ( struct file * file, char * buffer, size_t > length, loff_t * offset ) > { > <snip> > while ( length && * Message_Ptr ) > { > put_user( *(Message_Ptr), buffer); > Message_Ptr++; > buffer++; > length--; > } > > > the problem is that the module won't load with a report of : > unresolved symbol __put_user_X > > which implies that the size of the target (ptr) is neither 1, 2, nor 4 > bytes (!?) However, using copy_to_user works very well. > > what am I missing? > If I try to force it (via hacking the macro) to use put_user_1 it returns > garbage. Help? > This means that either the type has incorrect size (not 1, 2, or 4), or you forgot to compile with optimization. Did you specify -O2 on the command line when compiling? -- Kasper Dupont ------------------------------ From: [EMAIL PROTECTED] (Jonadab the Unsightly One) Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware Subject: Re: Processor ID Date: Wed, 28 Mar 2001 07:29:37 GMT Matt Woodyard <[EMAIL PROTECTED]> wrote: > Most hardware vendors donıt supply developers with API's that allow people > to track transactions by hardware part numbers over the internet. Thatıs > about the last thing we need, next you'll have processor specific liscenses > and "dongling". Could be worse... [Insert pseudoparanoid rambling about global-positioning chips with banking capabilities surgically implanted into every citizen at birth.] - jonadab ------------------------------ From: David Florez <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.apps Subject: Using DMA hardware from user space Date: Wed, 28 Mar 2001 11:42:42 +0200 Hi all, I have to develop a system in which a certain amount of memory will be needed to process image information and then this information will be send through an ASIC to the outside world. This ASIC has a PCI bridge, so it can access the memory through DMA. In order to avoid performance loss, the process that will manage the image in user space needs to locate this memory in continuos locked page frames somehow and obtain the physical addresses in order to program the ASIC DMA conveniently. (the ASIC registers are accessed from user address space through a driver). My first idea was to use a driver that initially gets this memory, and then allows user process to map it into its address space. The driver should provide some way to translate logical into physical address (maybe through ioctl that calls virt_to_phys()? ). I don't know if this is a good and clean approach. Any ideas will be very welcome. Many thanks. ------------------------------ From: Arne Driescher <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.apps Subject: Re: Using DMA hardware from user space Date: Wed, 28 Mar 2001 12:44:06 +0200 David Florez wrote: > > Hi all, > > I have to develop a system in which a certain amount of memory will be > needed to process image information and then this information will be > send through an ASIC to the outside world. This ASIC has a PCI bridge, > so it can access the memory through DMA. > > In order to avoid performance loss, the process that will manage the > image in user space needs to locate this memory in continuos locked page > frames somehow and obtain the physical addresses in order to program the > ASIC DMA conveniently. (the ASIC registers are accessed from user > address space through a driver). Hmm, ain't you mixing something? As far as I understand you have two things to manage: 1) A user space application generating some data that doesn't care about the physical memory layout of the buffer. 2) Some hardware that has to transfer the buffer via DMA. The user space program will tell the hardware what and when to transfer the data in the buffer. > > My first idea was to use a driver that initially gets this memory, and > then allows user process to map it into its address space. The driver > should provide some way to translate logical into physical address > (maybe through ioctl that calls virt_to_phys()? ). > - Your driver should allocate the memory blocks you need. This blocks should be choosen according to the needs of your DMA hardware (physical continous in memory). - You map this memory via mmap() into the user space. Independend of the memory layout of the physical blocks this can be done in a way that the application always sees this buffer as continous in its address space. - Your application should _not_ program the ASIC itsef. It should call your driver telling it what DMA transfer has to be done. The driver gets (by virt_to_bus()) the bus address of the buffer and can program the ASIC. -Arne ------------------------------ From: David YEUNG <[EMAIL PROTECTED]> Crossposted-To: comp.databases.oracle.server,comp.os.linux.setup,comp.os.linux.development.apps Subject: 64 bit I/O for RedHat EE for Oracle8i Date: Wed, 28 Mar 2001 19:08:06 +0800 We've bought the RedHat Linux Enterprise Edition Optimized for Oracle8i installed in a Intel PC. According to the specification, it should support 64 bit I/O. However, after I install both Linux and Oracle 8.1.7 and I try to create a data file larger than 2GB, the following error occurs: ================================================================================== SQL> create tablespace ts datafile '/data/u1/data1.dbf' size 10000M autoextend off 2 extent management local autoallocate; create tablespace ts datafile '/data/u1/data1.dbf' size 10000M autoextend off * ERROR at line 1: ORA-19502: write error on file "/data/u1/data1.dbf", blockno 231425 (blocksize=8192) ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file Additional information: 231425 Additional information: 64 Additional information: 231425 ================================================================================== Has anyone used the RedHat Linux EE for Oracle8i? Any idea how to create a larger size data file in Oracle? Thanks david ------------------------------ From: Jan Pietrusky <[EMAIL PROTECTED]> Subject: Parallel Port Date: Wed, 28 Mar 2001 13:59:05 +0200 Hello, how can I read and write values to or from the parallel port in user mode. If I'm root, I can use the write(), but read() failed. Why? I use /dev/port and I use open(). Thanks Jan -- --------------------------------------------------------------------- | Dipl.-Ing.(FH) Jan Pietrusky | Tel: +49 (0) 3677 678331 | | Institut fuer Mikroelektronik- und | FAX: +49 (0) 3677 678338 | | Mechatronik-Systeme | | | Langewiesener Strasse 22, 98693 Ilmenau | | |---------------------------------------------------------------------| | MAIL/WWW: [EMAIL PROTECTED], http://www.imms.de/ | --------------------------------------------------------------------- ------------------------------ ** FOR YOUR REFERENCE ** The service address, to which questions about the list itself and requests to be added to or deleted from it should be directed, is: Internet: [EMAIL PROTECTED] You can send mail to the entire list by posting to the comp.os.linux.development.system newsgroup. Linux may be obtained via one of these FTP sites: ftp.funet.fi pub/Linux tsx-11.mit.edu pub/linux sunsite.unc.edu pub/Linux End of Linux-Development-System Digest ******************************