[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
RE: [rtl] How do I link?????
hey man.
you sound like me :) (also an undergrad in Aust.)
the rt_proc.c is a kernel module, and hence has no access to normal Linux Devices (eg screen, disk and ethernet)
the only way to print to the screen from the kernel space is printk() /*same format as printf */
to compile stuff, here is a Makefile I use every other minute :)
# Makefile for RT apps
#
# first, set up the directories
PROJECT = /project
RTLINUX = ${PROJECT}/src/linux
INCLUDE = ${RTLINUX}/include
# flags to be sent to the compiler, -O2 (oh, not zero) is optimisation, -Wall is Warning all
CFLAGS = -O2 -Wall
# target, formst is:
# targetname: files it depends on
# <tab> the command to compile it
all: rt_proc.o monitor
# the main real time proc
# this says: my rt_proc is dependednt on the c file (duh)
# to compile it, -I include from this directory, it is a __kernel__ module, and it is __RT__ real time
rt_proc.o: rt_proc.c
gcc -I${INCLUDE} ${CFLAGS} -D__KERNEL__ -D__RT__ -c rt_proc.c -o rt_proc.o
# this is a program that monitors some real time fifo pipes that the rt_proc talks to.
monitor: monitor.c
gcc -I${INCLUDE} ${CFLAGS} -o monitor monitor.c
# end of Makefile
to then run your rt_proc, you must check that you are running the support modules
do this by running:
$> lsmod # list modules
output:
Module Pages Used by
rt_fifo_new 1 0
rt_prio_sched 2 0
the most important thing is the first column
if this is correct, then
$> insmod rt_proc.o # insert module
(no output - unless your module is wrong)
the things to remember are:
o you are programming in the kernel space
o if you stuff up a kernel module, it is likely to bring the machine down (harmlessly - but back you disks up)
hope this helps
regards
Jake
p.s. check out http://melnibone.levels.unisa.edu.au/project/index.html
there are some links to instructions and stuff
----------
From: Niroshan Carrol Rajadurai[SMTP:niroshan@ains.net.au]
Sent: Monday, 24 August, 1998 10:49 PM
To: documentation@rtlinux.cs.nmt.edu; rtl@rtlinux.cs.nmt.edu
Subject: [rtl] How do I link?????
Hi....
Um forgive my stupidity/ignorance if i am wrong.....
I am under the impression I can '#include <stdio.h>' and other
standard c libraries into rt_process.c .....
however the compiler says that the stadard 'C' function calls such as
'printf' are undefined symbols... this led me to the asumption that
rt_linux needed all linux function calls statically linked not dynamically
linked as is the norm..... So i manually linked a few shared libraries... only
to have rmeoved all the standard 'C' function calls, and get lower level
function calls
as undefined functions.... perhaps there is an easier way to do this, say
with a simple
flag at build time for 'gcc' or linker flag..... One of my head lecturers
has informed
that i am not worthy for not knowing this, but i am but a mear under-grad....
any assitance will be greatly appreciated....
before i get asked why i want to do this, i shoudl explain i guess.... um
well what we are doing is developed a satellite tracking station... i have
mentioned this before... So we have got basic rt-linux stuff happening...
but we want to place the sequence which controls the stae-machine of the
dish in rt-linux, for which we need to call stdio.h along with a few other
std libs.... Plus we want to setup a controller at priority 1, control all
the real time tasks below it... this way should any of our processes clog
up the linux box, then the priority '1' task which superceeds them all
should be able to step in and terminate the all, without a reboot.... I
have no problems with placing all this code free-to-web once it is all
developed.. I actually plan to have extensive documentation available with
chunks of code followed by chucks of explanation.... this has been a
downfall of the project in past years....
Thanks in advance
Niroshan
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.cs.nmt.edu OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.cs.nmt.edu
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.cs.nmt.edu OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.cs.nmt.edu
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/