To install

type 

make cortex.o 

to compile the file cortex.o

become root and copy this file to /boot with

cp cortex.o /boot
then do a 

/sbin/insmod -f /boot/cortex.o cortex_mem cortex_port=0x230 cortex_mem=0xD0000

If you have set the dip switches to move your card to a different port or
base memory location change this line. I REALLY recommend not putting the
memory location at 0xA0000 because it *can* conflict with your graphics
card.  you can put this in your rc.local file if you want

if you want to get debugging, instead do

/sbin/insmod -f /boot/cortex.o cortex_port=0x230 cortex_mem=0xD000 cortex_debug=3

if you want to assign the major device number to 50, instead do
/sbin/insmod -f /boot/cortex.o cortex_port=0x230 cortex_mem=0xD000 cortex_major=50

check this worked by doing a 

lsmod

you should see a module called cortex

find out what device it was installed as by doing a
 
cat /proc/devices 

you should see a line with a number from 1 to 63 then cortex. The number is
the major device number assigned to the driver. I will assume the device is
at 63 from here on. Just replace 63 in my instructions with whatever you
have.

make the /dev entries with

mknod /dev/cortex c 63 0
mknod /dev/cortex.pgm c 63 1

go back to being a normal user instead of root

Try to do a capture with 

cat /dev/cortex.pgm > /tmp/foo.pgm 

then display /tmp/foo.pgm with something like 
xv /tmp/foo.pgm

if this fails, check that you have a video camera turned on and connect to
the card. It will fail if there is not video source.

try making the other programs in directory with 

make 

Using the device

When you open /dev/cortex, it grabs a 512 by 486 frame, as you do reads it
gets the data in 8 bit gray scale. If you just want a small part of the
frame, seek to the location you want to start reading from and get the
data. This is much faster than loading the whole frame.

When you open /dev/cortex.pgm, it grabs a frame and when you read it it
returns data in the format of a pgm file. This is a very easy way to use
the device.


