Logbook for Ian Wilkinson 98138766


These documents will be available from my web site for backup reasons. These can be found at www.sgtwilko.f9.co.uk/c23-part2.tar.gz the file is a compressed tar file that will contain these documents in html format.


Most of the exercises and data in this log book will be based on my Linux system that I run on a Alpha AXP system (Not intel compatible), this is a 64bit system that uses firmware (a cross between hardware and software that enables it to boot to a unix prompt without loading an operating system). This enables the system to do all sorts of strange things like booting from the network with out needing a bootp, dhcp or dns servers.


Memory usage exercise:


This is the memory usage on my RedHat Linux Alpha AXP computer.


Mem: 45616K av, 37648K used, 7968K free, 11824K shrd, 1136K buff

Swap: 66520K av, 10296K used, 56224K free 12912K cached


The first line shows the current stare of RAM.

It shows that I have 45616KB of ram available of that 37648KB are used.

Of what is left 7968KB are shared and 1136KB are buffered.


The second line shows the swap file usage.

The Total available swap file is 66520KB of that 10296KB is used.

There are 56224KB free and of that 12912KB are cached.


The total memory value may seem a little strange, but as I am running an Alpha AXP with an IDE hard drive the firmware that is built into the Alpha is unable to boot from ide without loading an IDE firmware helper. This firmware helper takes up the top 1 to 2 MB of ram and forms a routine that is recalled when the computer goes through a soft reset.

Process Exercise:


This shows a list of processes that were running on my Linux computer. The first column shows who started the process, the second shows what the Program ID number is, the third the % cpu time, the forth the % of the total memory used, the fifth is the Virtual Size of the process, the sixth is the page table. TTY is the terminal that the program is running on, if ? Is shown then it is not running in a terminal. STAT is the state that the process is in, R for running, S for stopped, SW for waiting. N for nice (only uses space cpu time), Time is the amount of cpu time in minute:seconds used, start and command are self explanatory.


USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

root 1 0.0 0.2 3504 136 ? S Apr14 0:03 init

root 2 0.0 0.0 0 0 ? SW Apr14 0:00 [kflushd]

root 3 0.0 0.0 0 0 ? SW Apr14 0:00 [kpiod]

root 4 0.0 0.0 0 0 ? SW Apr14 0:20 [kswapd]

root 5 0.0 0.0 0 0 ? SW Apr14 0:00 [mdrecoveryd]

bin 290 0.0 0.0 2464 0 ? SW Apr14 0:00 [portmap]

root 337 0.1 0.6 5816 312 ? S Apr14 0:43 syslogd -m 0

root 348 0.0 0.6 2968 296 ? S Apr14 0:06 klogd

daemon 362 0.0 0.4 3536 224 ? S Apr14 0:00 /usr/sbin/atd

root 376 0.0 0.5 6880 264 ? S Apr14 0:05 crond

root 389 0.0 0.0 2608 0 ? SW Apr14 0:00 [cardmgr]

root 403 0.0 0.3 5776 160 ? S Apr14 0:00 inetd

root 417 0.0 0.0 6584 0 ? SW Apr14 0:00 [snmpd]

root 431 0.0 1.8 3848 864 ? S Apr14 0:20 named

root 451 0.1 6.1 2816 2816 ? S Apr14 0:31 xntpd -A

root 465 0.0 0.0 5840 0 ? SW Apr14 0:00 [lpd]

root 483 0.0 0.0 9040 0 ? SW Apr14 0:00 [rpc.statd]

root 494 0.0 0.0 2448 0 ? SW Apr14 0:00 [rpc.rquotad]

root 505 0.0 0.0 2512 0 ? SW Apr14 0:00 [rpc.mountd]

root 518 0.0 0.0 0 0 ? SW Apr14 0:04 [nfsd]

root 519 0.0 0.0 0 0 ? SW Apr14 0:00 [nfsd]

root 520 0.0 0.0 0 0 ? SW Apr14 0:00 [nfsd]

root 521 0.0 0.0 0 0 ? SW Apr14 0:00 [nfsd]

root 522 0.0 0.0 0 0 ? SW Apr14 0:00 [nfsd]

root 523 0.0 0.0 0 0 ? SW Apr14 0:00 [nfsd]

root 524 0.0 0.0 0 0 ? SW Apr14 0:00 [nfsd]

root 525 0.0 0.0 0 0 ? SW Apr14 0:00 [nfsd]

root 526 0.0 0.0 0 0 ? SW Apr14 0:00 [lockd]

root 527 0.0 0.0 0 0 ? SW Apr14 0:00 [rpciod]

root 694 0.0 0.0 2520 0 ? SW Apr14 0:00 [gpm]

xfs 745 0.0 0.2 7944 136 ? S Apr14 0:00 xfs

news 864 0.0 7.1 19752 3280 ? S Apr14 0:01 /usr/bin/innd -p5

news 866 0.0 0.4 12888 224 ? S Apr14 0:03 /usr/bin/actived

root 955 0.0 1.2 4048 576 ? S Apr14 0:06 /usr/local/bin/se

root 958 92.7 30.6 17880 13976 ? RN Apr14 394:49 ./setiathome -ver

root 960 0.0 0.0 2424 0 tty1 SW Apr14 0:00 [mingetty]

root 961 0.0 0.0 2424 0 tty2 SW Apr14 0:00 [mingetty]

root 962 0.0 0.0 2424 0 tty3 SW Apr14 0:00 [mingetty]

root 963 0.0 0.0 2424 0 tty4 SW Apr14 0:00 [mingetty]

root 964 0.0 0.0 2424 0 tty5 SW Apr14 0:00 [mingetty]

root 965 0.0 0.0 2424 0 tty6 SW Apr14 0:00 [mingetty]

root 967 0.0 0.2 2416 120 ? S Apr14 0:11 update (bdflush)

root 2547 0.0 0.2 11536 128 ? S Apr14 0:02 in.telnetd

root 2548 0.0 0.0 21296 0 pts/0 SW Apr14 0:00 [login]

wilko 2549 0.0 1.9 8680 904 pts/0 S Apr14 0:01 -bash

root 2605 0.0 1.4 8104 664 ttyS0 S 00:01 0:01 /usr/sbin/pppd ca

root 5636 0.0 0.2 11536 104 ? S 03:00 0:01 in.telnetd

root 5691 0.0 0.0 21296 0 pts/1 SW 03:01 0:00 [login]

tailmess 5692 0.0 0.0 8512 0 pts/1 SW 03:01 0:00 [tailmess]

root 5694 0.0 1.6 2432 744 pts/1 S 03:01 0:01 tail -f -n 28 /va

wilko 8371 0.0 3.2 7000 1472 pts/0 R 05:27 0:01 ps axu



Linux Memory Management.

I have been to the site mentioned in the document it seems to be a reasonable web site, but I have also been to these sites and some of them provide more information.


http://www.ssc.com/lj/issue30/kk30.html

http://khg.redhat.com/HyperNews/get/khg.html

http://www.linux.eu.org/Linux-MM/

http://web.mit.edu/tytso/www/linux/ext2intro.html

http://www.linuxdoc.org/LDP/tlk/

http://www.atnf.csiro.au/~rgooch/linux/vfs.txt

http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.3.html

http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.2.html

http://www.samba.org/~netfilter/kernel-hacking-HOWTO.html


I have also been reading through some of the Linux kernel source tree 2.3.99 .


While looking for a better description on process management I have failed to find anything that give a very good description of how linux works. Most descriptions are either very short or incomprehensible. I'm glad I'm doing memory management.


The file system is also a very nice system. Every file system driver translates the real file system into a sort of inode based system that the VFS (virtual File System) can read. Linux then treats every file system as the same thing. This works so well that you can mount windows shares across a network or NFS network shares or CDRom disk all in the same way and the users does not even have to know what it is. You can go from a local disk to a network drive without even knowing about it.


I still haven't been able to find anything useful about process management, but I have found out about some very strange things. Linux is being ported to the Nintendo 64! It's also being ported to things like the palm pilot (and having a hand writing interface bolted on to it) and also being ported to computers that have no memory management hardware. These ports are not going to be strictly Linux, the best is ELKS. I've downloaded it and installed in on my old 286 Laptop. I've found the unable to mount disk bug, but only in so far as I'm sometimes unable to mount a floppy disk now that it's on the hard disk.


It would seem that Linux needs hardware support to do memory management. This would be why linux only runs on 386 and above as they have the protected mode that stops processes from hurting each other. Shame that microsoft did not find it sooner...


I've also found some interesting differences between the Alpha AXP and other 64 bit hardware. The Ultra Sparc (64bit and made by Sun) has a big endian processor. I had thought that all modern processors were little endian. This must make porting software and operating system across even more difficult. I know that even small things like ping are slightly broken on the Alpha as it assumes that an integer is 32 bit, where as it's 64 bit on the Alpha. So every time I run ping I get unaligned traps. I've looked into this and according to one of the memory management sites I listed above, this is due to the program using a 32 bit boundary when the processor expects and only allows 64bit boundaries.


Memory management is a lot more interesting than I thought it was. Unlike other operating systems that try to load everything into memory first and then run it, Linux loads only the bits it needs and then maps the rest to virtual pages.


I'm not entirely sure if the deliverable is supposed to be 4 pages including the log book or 4 pages total for the overview of linux systems plus a log book of no more than 3000 words or everything is no more than 3000 words on 4 pages. Also it's not entirely clear if I'm only supposed to do memory management or if I'm supposed to focus on memory management, but include a small amount on the other subjects, so I've done the latter.