Linux-Development-Apps Digest #310, Volume #7 Sat, 31 Mar 01 17:13:13 EST Contents: help with keymapping in VIM 5.7 (John Prokopek) Re: arrow keys (Dave Blake) Making custom boot floppies without a floppy. ("J. E. Garrott Sr") how to start programming threads (Robert) Re: how to start programming threads ("Arthur H. Gold") SysV shared memory attach fail in apcupsd (Conrad Mukai) How to create a shared library in Linux? ("Alan Po") Re: How to create a shared library in Linux? (Chronos Tachyon) pthread_cond_wait + select question ("Robben Mario") how to create a boot disk accoring to the bootsect.S ("hushui") Re: pid ("Emilien Arino") Re: Processor ID (Norman Levin) Re: C-Programming, getchar(), console (Juergen Sauer) Re: Problem with ASM (Bernhard Weichart) ---------------------------------------------------------------------------- From: John Prokopek <[EMAIL PROTECTED]> Subject: help with keymapping in VIM 5.7 Date: Fri, 30 Mar 2001 17:18:54 -0500 I am looking for someone running vim5.7 on a redhat box who wouldn't mind trying something for me. I am trying to map the multiply key on the keypad. I should be able to do this by :map <kMultiply> :browse e<CR> this should open the "file open" dialog this works on my NT box but not on my rh7.0 box. If someone could give this a spin and get back to me I'd appreciate it. -- John D. Prokopek [EMAIL PROTECTED] ------------------------------ From: [EMAIL PROTECTED] (Dave Blake) Subject: Re: arrow keys Date: 31 Mar 2001 00:11:58 GMT Reply-To: [EMAIL PROTECTED] [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I know this seems like a simple question but what are > the ascii values for the up and down arrow keys? I've > looked at about 50 ascii charts and I can't find any with > the arrow keys. I want to catch them in a curses program > using getchar(). Don't use ascii codes. In curses, use KEY_DOWN KEY_UP KEY_LEFT KEY_RIGHT or read the header file yourself :) -- Dave Blake [EMAIL PROTECTED] ------------------------------ From: "J. E. Garrott Sr" <[EMAIL PROTECTED]> Subject: Making custom boot floppies without a floppy. Date: Fri, 30 Mar 2001 18:07:14 -0800 Assume I have a laptop computer without a floppy drive ( I don't, but assume it anyway :). I want to create a custom boot cdrom. This seems to require that I have a floppy drive to create the (lilo) boot section for the cd. Is there software, or a procedure, available that will allow this without the actual floppy drive? Thanks in Advance, John ------------------------------ From: Robert <[EMAIL PROTECTED]> Subject: how to start programming threads Date: Fri, 30 Mar 2001 18:16:55 -0800 Reply-To: [EMAIL PROTECTED] Hi, Can someone suggest a starting point for programming applications with threads in linux? I know basic things about multiple processes and synchronization in UNIX. Thank you for your help. ------------------------------ Date: Fri, 30 Mar 2001 21:11:36 -0600 From: "Arthur H. Gold" <[EMAIL PROTECTED]> Subject: Re: how to start programming threads Robert wrote: > > Hi, > > Can someone suggest a starting point for programming applications with > threads in linux? I know basic things about multiple processes and > synchronization in UNIX. > If the threading you know about is POSIX threads (pthreads) much of what you know will translate directly. A good starting point (which may provide enough information all by itself, depending upon how much background you have) would be the info pages for libc (type `info libc'), in the `add-ons' section, POSIX threads. There a few subtle (well, perhaps not so subtle) differences between true POSIX-compliant threads and linuxthreads; for the most part they're explained in the aforementioned info pages. Of course, the more or less definitive source is Dave Butenhof's book, `Programming with POSIX threads' (he's a frequent contributor to news:comp.programming.threads, another worthwhile resource). HTH, --ag -- Artie Gold, Austin, TX (finger the cs.utexas.edu account for more info) mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED] -- Clone Bernie! ------------------------------ From: Conrad Mukai <[EMAIL PROTECTED]> Subject: SysV shared memory attach fail in apcupsd Date: Fri, 30 Mar 2001 21:00:26 -0800 I'm trying to install a program called apcupsd, which monitors APC UPS's, which are battery backups for computers (I live in California). Anyway, we have successfully installed this program on several computers; however, one computer stubbornly refuses to run this program. The monitoring daemon starts, but when a call to shmat is made it returns with errno 43 (EIDRM--Identifier removed.) I'm wondering why the program fails to attach to shared memory on this particular computer, and runs fine on others. One peculiarity is that the key used to generate the shared memory pointer and attach to it is not from ftok(), but is hard coded. Thanks in advance for any help. -- ************************************************************ * Conrad Mukai "Consistency is the last resort of * * [EMAIL PROTECTED] the unimaginative." - Oscar Wilde * ************************************************************ ------------------------------ From: "Alan Po" <[EMAIL PROTECTED]> Crossposted-To: comp.os.linux.development.system,comp.os.linux.help Subject: How to create a shared library in Linux? Date: Sat, 31 Mar 2001 13:07:22 +0800 Dear sir As I know, there have some shared libraries in the directories /lib. Can I also create my personal share library so that my code can share to my application? Please tell me the metod, thanks a lot. Alan Po [EMAIL PROTECTED] ------------------------------ From: Chronos Tachyon <[EMAIL PROTECTED]> Subject: Re: How to create a shared library in Linux? Crossposted-To: comp.os.linux.development.system,comp.os.linux.help Date: Sat, 31 Mar 2001 05:48:53 GMT On Fri 30 Mar 2001 11:07, Alan Po wrote: > Dear sir > > As I know, there have some shared libraries in the directories /lib. Can I > also create my personal share library so that my code can share to my > application? Please tell me the metod, thanks a lot. > [Note: c.o.l.d.system is offtopic, it's more for kernel-level questions.] I find the phrasing of the question rather disturbing... but the answer is a very strong "yes". Basically, it's just a matter of providing the "-fPIC" option to gcc when compiling your .c files, and using the "-shared" option when linking your .o files together into a library. Here's a quick example: --- begin foo.c --- #include <stdio.h> void hello(void) { printf("Hello, World!\n"); } --- end --- --- begin bar.c --- void hello(void); int main(void) { hello(); return 0; } --- end --- To compile and link the library: gcc -O2 -fPIC -o foo.o -c foo.c gcc -shared -o libfoo.so foo.o To compile and link the program: gcc -O2 -o bar.o -c bar.c gcc -o testprog bar.o -L. -lfoo -- Chronos Tachyon Guardian of Eristic Paraphernalia Gatekeeper of the Region of Thud [Reply instructions: My real domain is "echo <address> | cut -d. -f6,7"] ------------------------------ From: "Robben Mario" <[EMAIL PROTECTED]> Subject: pthread_cond_wait + select question Date: Sat, 31 Mar 2001 09:06:24 GMT Is there an easy way on how to wait for a condition variable + some filedescriptor is ready for reading/writing. What I need is a function like "pthread_cond_wait_select". Is there a function available on how to wait for several condition variables (e.g. in Win32 you have a function WaitForMultipleObjects). Thx in advance. ------------------------------ From: "hushui" <[EMAIL PROTECTED]> Subject: how to create a boot disk accoring to the bootsect.S Date: Sat, 31 Mar 2001 21:34:38 +0800 I have seen the boot disk of bootsect.S does not have a file system . When load the kernel, the bootcode read the floppy by read each sector of the disk. Does it?? When we create a boot disk in the install time ,it is a disk with ext2 file system . How can I create a raw boot disk ??? ------------------------------ From: "Emilien Arino" <[EMAIL PROTECTED]> Subject: Re: pid Date: Sun, 1 Apr 2001 15:55:33 +0200 thanks ------------------------------ Date: Sat, 31 Mar 2001 08:06:23 -0600 From: Norman Levin <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] Crossposted-To: comp.os.linux.hardware,comp.os.linux.development.system Subject: Re: Processor ID Kasper Dupont wrote: > > [EMAIL PROTECTED] wrote: > > > > In article <[EMAIL PROTECTED]>, ** snipped ** this is much worry about nothing - when you have real things to worry about. Whether a mac address is read once or with every packet makes no difference. The fact is, YOU are identifiable. The thought that CPUID is going to be more of a tie to U vs your MAC address is rediculous. All you need to do is run winipcfg or ifconfig and ship that info down. Sorry. this cpuid is just a piece of *(& that lets people get worked up. Get over it. -- Norman Levin ------------------------------ From: Juergen Sauer <[EMAIL PROTECTED]> Subject: Re: C-Programming, getchar(), console Date: 31 Mar 2001 12:58:14 GMT "Jakub Orbán" <[EMAIL PROTECTED]> schrieb am Fri, 30 Mar 2001 14:16:07 GMT in comp.os.linux.development.apps: > Hi, > I'm new to linux, but i already c-programming (compiling progs with gcc, > starting on the console (bash)) > now i have a simple small question: > wenn i use getchar() in my programm, i have always to press <enter>, in > order to "get the attention" of the function > is there a function that reacts on a sigle key-press? > or: what the solution to this prob? Simple way the other told to you in this thread. The clue is the philosophy of an Multi-User-Multitasktin System, each possible User may have an own Keyboard and Screen, called Terminal. A Terminal may be connected over multiple ways: Serial/Modem, Network and Terminalemulators, Terminalservers etc. The classic Terminal are physical Devices with a serial V.24 connector, a Keyboard and a Text-Monitor. Very well-known Devices were "VT52", "VT100" by DIGITAL|DEC. There are also some Software-Only Terminals: Linux Console (Alt-F1, ...) AIX Console, SunOS Console, X11 XTerm, KDE Console (Konsole). Each Terminal Device may have it's own configuration and Control Sequences, depending from manufacturer and capabilities of the specific device. For correct programming is a unified method needed to control the Text-Terminals, independend from manufacturer. There are such methods: you have to handle the device by yourself with: a. ancient termcap Library b. terminfo c. classic stty control d. ncurses (sitting above b. terminfo) a. - c. are much complicated in som cases and not really portable and unversial. The best way is IMHO to use curses|ncurses, which you should already have on your box. "make menuconfig" in the KernelSource will shows an curses Menue up. I'd suggest you go on and learn about ncurses, your Applications will be able to run on any known terminal, without you have to know them. mfG Jojo -- Jürgen Sauer - AutomatiX GmbH, +49-4209-4699, [EMAIL PROTECTED] http://www.automatix.de to Mail me: remove: -not-for-spawm- ------------------------------ From: Bernhard Weichart <[EMAIL PROTECTED]> Subject: Re: Problem with ASM Date: Sat, 31 Mar 2001 23:01:04 +0200 Ruben Real wrote: = > i would suggest to XOR the eax register to make sure there is no data i= n it. > (my knowledge is from msdos, so i don=B4t know if it applies here. > = > bye > ruben > = > comp: movl $ch,%eax # Compare $ch with $ts > xor %eax, %eax # clear eax > cmp $ts,%eax > jne kio > = tnx for coming back. I'll tested it but without an effect. Do you have an other idea? mfg Bernhard ------------------------------ ** 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.apps 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-Apps Digest ******************************