[minor aesthetic] nic: print ip in bold

kernel/nic.s:
	nic_print: brighten the IP for easy recognition.
txt2html: fix paragraph detection

util/txt2html.pl:
	fix the regular expression determining whether a line is a tag
	and should be left alone, or whether it is plain text.
WEB/DOC: add new/updated labels dynamically

	SUMMARY

		The documentation list now dynamically appends 'new' and
		'updated' labels if the document is modified in the last
		week.

Makefile:
	invoke genlinks.pl's new feature.

root/www/index.html:
	don't include doc.inc twice.

util/genlinks.pl:
	add feature '--mtime', which uses git log to find the latest
	modification of files in DOC/ and adds mtime and mod (M,A)
	attributes to the link tags,
	and appends javascript dynamically calculating the age of the
	change and adding 'new' and 'updated' spans.
ISO9660,ATAPI: fix buffer pointer modification

	SUMMARY

		Reading files of more than one sector in ISO9660
		resulted in the buffer pointer (esi) being modified,
		thereby causing 'doc.inc' to be included incorrecly.

		Now, esi is preserved in atapi operations.

kernel/ata.s:
	atapi_read_capacity: set esi to packet buffer explicitly.
	atapi_read12$: preserve esi.
	atapi_packet_command: preserve esi.

kernel/fs/iso9660.s:
	mount: due to esi being preserved, set esi to the primary
	volume descriptor for verification explicitly.

	remove push/pop esi around atapi_read12$ calls.
TCP: fix profuse mutex unlocking on (ARP) failure.

	SUMMARY

		Due to the improved mutex consistency checks introduced
		recently, faulty execution flows as triggered by error
		conditions pop up now and then, revealing an incorrect
		path through a synchronized block.

		In this case, net_ipv4_header_put, which triggers ARP
		resolution, caused the TCP_CONN mutex to be unlocked
		before it was locked.

kernel/net/tcp.s:
	net_tcp_handle_syn$: fix execution flow on errors as described.
Add CRC32.

kernel/Makefile:
	record lib/crc32.s

kernel/shell.s:
	add crc32 commandline, hasing the first argument.

lib/crc32.s:
	implementation as per RFC1952 (GZIP).
NET: fix mutex imbalance; improve stability; clean

	SUMMARY

		Fix a bug where the NET mutex was not unlocked
		when the rx queue was full.
		Consolidate the rx network code by deciding for
		having a queue and a task with an inner semaphore
		loop;
		Clean up the mutex macros.
		Keep track of dropped packet count.

kernel/mutex.s:
	remove unused macros MUTEX_SCHEDLOCK and old MUTEX_SPINLOCK.
	make MUTEX_UNLOCK the main implementation and have
	MUTEX_UNLOCK_ call it;
	idem for MUTEX_SPINLOCK.
	MUTEX_LOCK: don't store lock address on fail.
	MUTEX_SPINLOCK: set timeout to 1 million yields - high enough
	to fix network flooding issues; only invoke debugger when
	MUTEX_ASSERT is true, but log the temporary fail.

kernel/net/net.s:
	FIX BUG: on packet drop, unlock the mutex.

	net_buffer_get: clear the buffer;
	add net_buffers_print;
	protocol_checksum: do nothing if payload is empty;

	finalize decision on the packet handler task looping
	rather than rescheduling the task;

	finalize decision on using the rx queue;

	remove debug and obsolete code; cleanup;

	count dropped packets in the nic object;

kernel/net/nic.s:
	add nic_rx_dropped field;
	nic_print: print dropped packet count.

util/flood.pl: (ADD)
	small UDP flood script to test kernel stability under high
	network load.
DOC: add docs; add doc build api.

	SUMMARY

		Rather than grepping the DOC dir, it is now possible
		to use a .index file listing the files to be included
		in the website. This is intended to allow to specify
		certain attributes to the docments and order them in
		a tree structure.
		Using DOC/.index will mean that the Makefile need not
		be touched when documents are added. Further, the
		doctools script will be integrated with the genlinks
		scripts to provide for a more uniform DOC access API
		during build.

DOC/Alert.txt:
	add notes on designing system alerts into the console
	and interrupt handlers.

DOC/CloudNet.txt:
	Describe crash detection protocol.

DOC/Library.txt:
	notes on copy-on-write pages, code and data ordering
	and runtime optimization.

DOC/.index:
	list of all .txt and .html files to be deployed in the website.

Makefile:
	replace the literal TXTDOC list with a call to the new doctools
	script.

util/doctools.pl:
	This script provides an interface to the documentation, to be used
	for generating the website. At current it checks for a .index
	file in the document directory, parses it, and prints a sanitized
	list. If no such file exists, it simply lists the files.

util/genlinks.pl:
	add support for a new 'mod' attribute 'N', for files that are
	present but not yet committed (i.e. git log doesn't have a
	timestamp for it).
MUTEX: track lock/unlock times

kernel/mutex.s:
	on successful (un)lock, store clock.

kernel/debugger/debugger.s:
	debugger_mutex_print: print (un)lock times (as clock).
DEBUGGER: properly restore mutexes.
FS: don't print stacktrace on end-of-directory

kernel/fs.s:
	most FS implementations use CF=1 to indicate that there is
	no current directory entry, i.e., the end of the list is
	reached.
	The stacktrace was added to distinguish errors from the normal
	condition of having reached the end of the list. However,
	the fs_api_nextentry will continue to use CF to indicate end-of-list.
	Instead, a stacktrace is printed when an fs level error occurs, which
	is at current when the handle is invalid.
[WIP] CLOUD: enable mcast/bcast ping.

kernel/net/cloudnet.s:
	start cloud by default (enable periodic ping);

	_calc_time_clocks$: add method to calculate number of clocks
	for a given millisecond-based period in order to have quick
	timeout evaluations (simply compare clockticks rather than
	fixed point time calculations and possibly PIT accesses).

	cloud_cast_init: load cloud_nic (happened to already be the case)
	and don't jump to wrong label on error but simply continue.

	packet_ping$: add cluster era and node age.

	cluster_ping: update the packet with cluster era/node age,
	and use MCAST/BCAST rather than pinging all nodes individually.
	Since this method is called periodically, also add a verification
	for all known nodes' online status; the action taken in either
	online or offline case at current is simply to print the state
	to test the algorithm.

	cloudnet_handle_packet: only register/add cluster node on a
	hello packet; detect 'ping' packets and update the node's last_seen.

	cmd_cloud_print$: print online/offline status.

	_print_time$: preserve registers.
WEB,CLOUD: show node status

kernel/net/cloudnet.s:
	cluster_stream_nodes_list: also show the online/offline status
	in the web list and table.

	_html_cell$: insert space in list mode.
DOC: merge genlinks.pl and doctools.pl
CLOUD: dynamic status verbosity

kernel/net/cloudnet.s:
	add 'status' command alias for default action;
	add global '-v' option;
	reduce 'cloud [status]' default verbosity.
	(max verbosity level at current is 2)
CLOUD: fix print last_seen at verbosity 0

kernel/net/cloudnet.s:
	print last seen, not met;
	fix whitespace
DEBUGGER: print mutex fix

kernel/debugger/debugger.s:
	debugger_print_mutex:
	- fix order: first address, then clock
	- fix print unlock location
CloudNet: automatically reboot halted nodes.

	SUMMARY

		The interface between the network packet handler
		and the NIC drivers prescans packets for a reboot
		packet, and reboots the host if it matches.

		All cluster nodes will send a reboot packet to any
		node determined to be offline by having exceeded the
		ping timeout.

		A node can be rebooted with:

		perl -e 'print pack("L", 0x1337c0de)' | nc -u -p 999 NODE_IP 999

		Obviously, this commit is proof-of-concept and will be
		improved upon.

kernel/debugger/debugger.s:
	debugger: don't disable PIC interrupts.
	This allows for NIC packet reception among other things.

	NOTE: this may mean that certain errors will cause doublefaults
	or flood the screen with exceptions.

kernel/net/cloudnet.s:
	init: sleep 1 second before entering ping loop to ensure
	timeout detection on the first cycle.

	cluster_ping:
	- count online nodes
	- send reboot packet to offline nodes

	add cluster_reboot_node: manually construct UDP packet with
	magic code, bypassing ARP resolution (which the node to
	reboot is unlikely to answer if it has crashed). Note that
	even though all nodes communicate with each other, they do
	so using multicast, and thus do not have the MACs in the ARP
	table, although the MACs are stored in the cluster_nodes array.

	cmd_cloud: add "reboot" command, taking the hostname as argument.
	(note: rebooting localhost does not work using this method).

kernel/net/ipv4.s:
	net_ipv4_header_put: add option to bypass ARP resolution.

kernel/net/net.s:
	net_rx_packet: since this method is called by all NIC drivers,
	the check for a reboot packet is done here, before attempting
	to queue the packet for processing.

	add method net_check_reboot_packet: unsecure check using dst MAC,
	dst IP, UDP protocol, UDP ports, and a magic payload.
	TODO: add check for sender MAC and sender IP.
	TODO: make secure
	TODO: improve separation between cloudnet and the core network
	layer, as the cloud port (999) is used.
	TODO: make configurable (env var/cloud config).

kernel/net/udp.s:
	net_udp_header_put: add note on use of eax as parameter
	specifying ports being confusing since tcp uses edx.