summaryrefslogtreecommitdiff
path: root/FlightComputerSoftware2002.mdwn
blob: 1e6fe860f1f2b25ae29b868da9cfccde3fe47262 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# <a name="Details of Flight Computer Softw"></a> Details of Flight Computer Software for 2002 Launches

The [[FlightComputer]] is running [Debian GNU/Linux](http://www.debian.org)'s 'sarge' distribution. This was done to limit differences in shared library support between the development hosts and flight computers, so that testing on the development host would have more validity.

### <a name="Bootstrapping the flight compute"></a> Bootstrapping the flight computer

I used an old 486 computer with a floppy disk attached, an ISA VGA card, a NE2000 ISA network card, and ISA 16550A serial port card. The Flight computer's [[SanDISK]] [[CompactFLASH]] card is plugged into its TAPR board, connected to the 486 with an IDE cable, and jumpered to serve as the master harddisk for the 486. You'll also need a fast net connection (DSL is fine).

##### <a name="Installation on foreign hardware"></a> Installation on foreign hardware

Download the Debian install floppy images. Use them to do as minimal an install of Debian as possible via the network. The [[attached output|FlightComputerSoftware2002/dpkg.out]] of 'dpkg --get-selections' is a useful guide for the eventual goal -- you can use that as input to 'dpkg --set-selections' prior to an 'apt-get dselect-upgrade'

##### <a name="Trimming it down"></a> Trimming it down

deborphan and debfoster are very helpful for trimming down the list of installed packages. Also, periodically try to run 'apt-get clean' to clear the local package cache and also 'rm -rf /usr/share/doc/\*'. If there isn't enough space available on the compact flash card to do everything you need, then work with a few packages at a time with 'apt-get install ....'.

##### <a name="Configure a kernel"></a> Configure a kernel

Use another Debian computer, configured to be able to build kernels from source using the debian make-kpkg utility. Download the 2.4.18 debian kernel source and compile the kernel. See kernel configuration below. Note that it includes support for a serial console, and both the NE2000 network adapter as well as the Davicom network device on the flight computer board. See the [[attached kernel .config|FlightComputerSoftware2002/kernel.config]] (note it is set up for just the FC hardware itself, and not for the NE2k card, floppy, etc).

##### <a name="Configure lilo"></a> Configure lilo

Lilo must be configured to boot using a serial console. See attached [[/etc/lilo.conf|FlightComputerSoftware2002/lilo.conf]] (note it is set up just for the FC hardware itself, and not for booting on different hardware).

Recent change to lilo.conf: delay=30 (three seconds instead of ten, speeds development)

##### <a name="Booting test and real hardware"></a> Booting test and real hardware

Test the installed kernel on the 486 hardware using a serial port console. Tweak and trim where possible. Then get it running on the flight computer. Minicom with a serial crossover cable is helpful for talking to the system booting on the serial port. Bring up the network adapter (dmfe), then ssh, then you can continue tweaking the installed packages and disk space.

## <a name="Refinements"></a> Refinements

Set up a ram-based /tmp using tmpfs. See attached [[/etc/fstab|FlightComputerSoftware2002/fstab]].

##### <a name="Set up can driver to start on bo"></a> Set up can driver to start on boot

Make a /lib/modules/2.4.18/misc directory and add the can driver (can.o) to it. Place "can" in the /etc/modules and create a /etc/modutils/local file, and place the following lines in it to support the can driver's loading: --lines go here--

Run update-modules to add the /etc/modutils/local file into /etc/modules.conf, then run /etc/init.d/modutils to cause the drivers kernel modules to load up.

##### <a name="Set up wireless to come up on bo"></a> Set up wireless to come up on boot

Add the following to /etc/modules: --lines go here--

Then, edit /etc/pcmcia/wireless.opts to identify and configure the card for channel 1, Ad-Hoc demo mode operation. The hex bytes at the start of these blocks must match the first three bytes of the wireless card's MAC address.

    # Setup for rocket network 10.0.0.0, ad-hoc mode
    rocket,*,*,00:02:2D:*)
        INFO="Lucent Orinoco for Rocket"
        ESSID=""
        MODE="Ad-Hoc"
        RATE="2M"
        FREQ="2.412G"
        IWCONFIG="mode ad-hoc channel 1"
        IWPRIV="set_port3 1"
        ;;

Lastly, edit /etc/pcmcia/network.opts to configure the IP address and network for the wireless link (FC is address 10.0.0.1 and LTC is address 10.0.0.2, network 10.0.0.0, broadcast 10.0.0.255, netmask 255.255.255.0):

    rocket,*,*,00:02:2D:*)
        INFO="Orinoco network setup fort"
        IF_PORT=""
        BOOTP="n"
        DHCP_HOSTNAME=""
        PPPOE="n"
        WHEREAMI='n'
        IPADDR="10.0.0.1"
        NETMASK="255.255.255.0"
        NETWORK="10.0.0.0"
        BROADCAST="10.0.0.255"
        # the following is useful for accessing the net via the laptop during development
        GATEWAY="10.0.0.3"
        DOMAIN="psas.pdx.edu"
        SEARCH="psas.pdx.edu"
        DNS_1="10.0.0.3"
        DNS_2=""
        DNS_3=""
        MOUNTS=""
        MTU=""
        IPX_FRAME=""
        IPX_NETNUM=""
        IPMASQ="n"
        start_fn () { return; }
        stop_fn () { return; }
        NO_CHECK=n
        NO_FUSER=n
        ;;

Remove and reinstall the card using "cardctl eject 0; sleep 10; cardctl insert 0". It should come up fine.

##### <a name="Other wireless helpful hints"></a> Other wireless helpful hints

It may be useful to set up the laptop (10.0.0.3) that is talking to the flight computer similarly. Also, set up the debian packages iptables and ipmasq so that the flight computer can NAT through the laptop to the rest of the world. This makes it possible for the flight computer to do ntpdate to set the system time, run apt-get and the like.

-- [[JamesPerkins]] - 14 Aug 2002 <br />

The preceding setup is also valid (replacing the IPADDR with 10.0.0.2) for the launch tower computer.

Eventually, you will also want to add the primary software for FC/LTC to run on startup. Add a script named S99[name] to /etc/init.d/rc99.d/ to launch the main program.