Skip to contentSkip to conversation

newbie...please help.....

DISCUSSION teo_icKs 3 participants 3 messages Sep 26, 2002 – Oct 1, 2002

lore
Share & tools
lore

teo_icKs

author
#0 lore raw

hi,

if you want to make bin in ELKS (and you haven't its libc)you must use its include file with bcc and then statically link file object in your app;
First of all install ELKS source files (for ex. /usr/src/elks) in your linux
environment; instead use bcc in this way:

bcc -0 -ansi -I/usr/bcc/include/ -I/usr/src/elks/include/ -o
Parallela parallela.c /usr/src/elks/arch/i86/lib/outportb.o

the modified source code of your app...

#include<arch/io.h> /* is the correct position of io.h in ELKS */
#include<unistd.h>
int main()

{ 
       /*- ioperm(0x378,3,1);  to enable access to the parallel port.. 
				not implement				*/
	
       for(;;){ 
       		outb(0x88,0x378); /* writing 0x88 or 10001000b to the data 
            	                     pins..thereby lighting the LEDs.... */
       } 
} 

before this you must compile the implementation of outb function; this is an assembly file in the source code of ELKS kernel.
If have you compiled the Kernel ..... good
(you can link directly the object file> outportb.o)
else learn to make it!!!! :-)

If you have the small version of libc, don't you need to statically link it in your app.

Quoted 8 lines

whenever i am running the above program after compiling thru gcc...i get the LEDs lighted, alright...but the other LEDs that are not supposed to light up..also light up and then light off..although very fast...for example if i write hex F8 on the data port...
what i should get is this: on on on on on off off off in my LEDs... but the last three LEDs switch between on and off states very fast..thus what i get actually is a series of alternating F8 and FF in my LEDs...can u suggest any thing???

THis effect is probably caused by another process who use this port; Kill all suspected process and try it again! ....:-0
With ELKS kernel and the code that I have fixed, this problem there isn't.

Now I don't know what process could uses your parallel port...

however in Linux kernel, use this port with read, write, open and the other syscall! It's safer then the direct access to register.

teo_icKs .... .... .... ..... ....
______________________________________________________________________
Scarica il nuovo Yahoo! Messenger: con webcam, nuove faccine e tante altre novità.
http://it.yahoo.com/mail_it/foot/?http://it.messenger.yahoo.com/

#1 lore raw

thanks for ur help....

hi teo and all linux programmers
thanks for ur reply..ur mail helped me a lot...if u had not replied i would never have been able to finish my seminar presentation with a demo of ELKS....
actually i am an engineering student in electronics and comm...and love the idea of toying with linux..i had my seminar on "embedded linux" and was interested in a short demo of ELKS...my LED array was there but i was having a problem with them as u already know..
until u replied mail..i would never have done it...

thanks for helping me out.....i shall never forget ur assistance... now for some technical doubts that i have...

i have created my own ELKS kernel image...but how do i create my root disk?
using loopback?? but then what abt ramdisk word and other issues abt size and libraries..??

please help..
i tried making a boot+root disk after reading boot disk howto..but the kernel was showing a 'kernel panic' situation...
please advise what to do..i am confused....kernel is loading..ramdisk is also loading....ramdisk is also mounting / in it...but when it comes to running init..it simply says" init not found..pass init= parm to kernel.." kernel panic simply hangs the machine...for ur nformation..i would like to add that i have checked my library dependencies with ldd and made sure that i have 'init' in my /bin and /sbin directories...still it is not working... this happened
with normal linux..is the same procedure to be applied for ELKS too??

i was usingg 1.44mb floppy disk...
please help in this matter...
thanks in advance......

seemanta ;)

-------------------------------------------------------------------------------
Final Year B.E.
Electronics and Communication Engineering
Hostel No:5,Room No:101
Malaviya National Institute of Technology
Jaipur,Rajasthan
PIN-302017
INDIA
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
To iterate is human, to recurse divine.
-Anonymous
-------------------------------------------------------------------------------

#2 lore raw

Re: thanks for ur help....

Quoted 3 lines · Seemanta Dutta

thanks for ur reply..ur mail helped me a lot...if u had not replied i would never have been able to finish my seminar presentation with a demo of ELKS....

That's good - maybe you could post your seminar paper up somewhere. I've got some slides from my LUG presentation which I'll put up at some point too..

Quoted 5 lines

i have created my own ELKS kernel image...but how do i create my root disk?
using loopback?? but then what abt ramdisk word and other issues abt size and libraries..??

The real catch is creating the correct file format

You need to create a Minix v1 fs.

1) dd if=/dev/zero of=root bs=1024 count=1440
2) /sbin/mkfs.minix -n14 root 1440

You can then mount this via loopback.

Populating the filesystem I suggest you look at the images from Harry's site and use the filesystems as a base

http://rainbow.cs.unipi.gr/~harkal/ELKS/images/

You can also look at the elkscmd for the root_template and the device numbers, but this isn't working for me in cvs atm.

I made a larger root image to hold the net stuff, and put some odds and ends on it - I make a rootfs with Adventure on it but there are still some bugs with input so not playable.

Paul