MEM refactor: remove final references to mem_*.
Rename mem_handle.s to handles.s
Fix stacktrace
OOFS: oofs_vol printing updates

kernel/fs/oofs/oofs_vol.s:
	print class for unloaded entries and other minor print updates.
Add Gittorrent document
Mem/Handles: dynamic allocation routine.

kernel/lib/handles.s:
	add handles_method_alloc pointer to handles structure, so that
	code using the handles methods can provide it's own routine for
	allocating the handle array.

	handle_get: make global; call handles_alloc indirectly.

kernel/lib/ll.s:
	make ll_insert_sorted$ global.

kernel/lib/mem.s:
	add mem_handles_method_alloc in handles struct definition;
	mem_init: initialize the method_alloc field.
[EXPERIMENTAL] OOFS: alloc persistence; oofs save

	SUMMARY

		Implement saving and loading oofs_alloc and the
		self-referential handle array.

		Implement saving of individual entries using cmd_oofs.

		Updating oofs:

			oofs [mountpoint] add oofs_alloc <sectors_hex>
			oofs [mountpoint] save <entrynumber_hex>
			oofs [mountpoint] save

kernel/fs.s:
	also debug fs_obj_read.

kernel/fs/fs_oofs.s:
	allow saving of any entry:
	add [class|index_hex] argument to oofs save
	add parse_entry_arg$ to parse class or entry index.

kernel/fs/oofs/oofs.s:
	remove include of oofs_handles.s (should not have been committed).

kernel/fs/oofs/oofs_alloc.s:
	rename class to oofs_alloc (drop _tbl).
	Add doc.

	have init set up the handles handle and a handle with all
	free space.

	add oofs_alloc_handles$, called by handles.s to allocate/resize
	the handles array.

	implement save and load:
		first sector is reserved, containing linked list edges,
		and the address and size of the handles array.
		also loads and saves the handles array.

	print: defer to handles_print in handles.s.

kernel/fs/oofs/oofs_array.s:
	call persistent_api_resize rather than class_instance_resize to trigger
	child address changed event.

kernel/fs/oofs/oofs_persistent.s:

	XXX DEBUG

kernel/fs/oofs/oofs_table.s:
	oofs_table_add: disable dummy lookup.

kernel/fs/oofs/oofs_vol.s:
	oofs_vol_add: first record object instance, then call constructor,
	so that the child moved eventhandler finds the entry.

	oofs_vol_load_entry: record the object instance before calling
	constructor - same reason.

	refactor: add oofs_vol_record_child$, a more efficient array.set().
OOFS: minor fixes; auto-load oofs_alloc.

kernel/fs/fs_oofs.s:
	load and remember oofs_alloc on mount.

kernel/fs/oofs/oofs_table.s:
	get: nullpointer check.

kernel/fs/oofs/oofs_vol.s:
	cleanup;
	add: use record_child instead of ptr_array_newentry.
	delete: fix eax.
	load_entry: cleanup.
	record_child$: preserve edx.
	child_moved: check array capacity, not index.
	print: idem.
	get_obj: idem, and return CF=1 on null entry.
oofs_vol: unregister child on init failure
FS: check size; clear unrequested data.

kernel/fs.s:
	fs_obj_rw_init$: check if the size fits within the partition aswell.
	fs_obj_read: clear data that was not requested after read.
OOFS: implement allocation; add handle txtab.

	SUMMARY
		Implement allocating diskspace.

		oofs_alloc now allows to keep track of a translation
		table referring to handles which may move when resized.

		oofs_alloc keeps track of one more handle in it's reserved
		sector, free to be used by fs, called txtab. It is agnostic
		of it's contents except that it must extend oofs_persistent.

		Add class oofs_txtab extends array, to keep track of special
		handles, such as the root directory.

		oofs_alloc uses handle_caller to contain the number of
		initialized sectors and clears the data (in txtab) after load
		that was not initialized.

kernel/fs/fs_oofs.s:
	cleanup.
	print name of unimplemented fs_api methods.

	begin implementing fs_oofs_open: lookup alloc.txtab.

kernel/fs/oofs/oofs.s:
	document oofs_child_moved arguments;
	include txtab.s.

kernel/fs/oofs/oofs_alloc.s:
	declare global apis (alloc, txtab_get).
	add documentation.

	add fields: txtab_idx (persistent), txtab (volatile).
	override oofs_api_child_moved to keep track of txtab instance.

	declare and implement api:
	- alloc: allocates a number of sectors using the handle code.
	- txtab_get: instantiates and loads the given class using the txtab
	  handle.

	init:
	- record the free space handle in handles_ll_fs (by size).
	- allocate a one sector handle as txtab_idx and store it in the
	  reserved sector.

	alloc_handles: clean debug; preserve eax.

	add oofs_alloc_handle_load (static), called by txtab_get,
	which calls the constructor of the given instance (setting lba/size),
	and calls load, temporarily overriding the onload method with
	oofs_alloc_onload_proxy$ to clear uninitialized data. The handle_caller
	field is used to specify the number of initialized sectors of that
	handle.

	oofs_alloc_print: also print the txtab handle index.

kernel/fs/oofs/oofs_array.s:
	clear array count in constructor.
	clean debug.

	onload:
	- fix calculating persistent data size.
	- recalculate dataptr arg of onload after persistent.read as the object
	  may have been resized.

kernel/fs/oofs/oofs_persistent.s:
	reduce debug level; print bytes to load aswell.

kernel/fs/oofs/oofs_table.s:
	load: set bytes to read to one sector, since the table size is
	unknown before the first sector is loaded. This is now needed,
	otherwise fs_obj.read will clear table data.

kernel/lib/handles.s:
	move .globals to top of file;
	declare handle_find as global.

kernel/oo.s:
	add stracktrace to class_deleteinstance.
DOC: Add VersionControl
OOFS: init HEAD; load fixes. OO: invokevirtual.

	SUMMARY

		Upon opening a mounted OOFS volume, the txtab is now
		initialized with a symbolic handle reference representing
		HEAD or the root directory, and the txtab is persisted.

kernel/fs/fs.s:
	disable fs_obj_(read|write) debug.
	add disabled keep/clear debug in fs_obj_read to trace what data is
	cleared.

kernel/fs/fs_oofs.s:
	open: open root initializes txtab with a HEAD handle.

kernel/fs/oofs/oofs_alloc.s:
	txtab_get: return cached instance.

	add handle_save, taking handle and object, which updates
	the initialized handle size (to 1 sector, hardcoded, XXX TODO).

	add txtab_save, no arguments, forwarding to handle_save, to keep
	txtab_idx private.

	init: or handle flags, rather than setting them (maintains ALLOCATED),
	and insert the handle in the address list.

	save: fix: save actual handle data.

	load: load full sector, prevent fs_obj_read from clearing the tail.

	print: also print txtab.

kernel/fs/oofs/oofs_array.s:
	remove copied,unused struct.

	load: load full sector (prevent fs_obj_read from clearing data).

kernel/fs/oofs/oofs_txtab.s:
	remove copied,unused struct

	add get and set: array access methods.
	# XXX perhaps move to oofs_array.s

	declare local array count, array data labels
	# XXX perhaps move to oofs_array.s

	print_el: print element index and handle index.

kernel/oo.s:
	add class_invoke_virtual and INVOKEVIRTUAL macro.

	class_instanceof: verify class argument.
[WIP] OOFS: implement ls, touch/mkdir.

	SUMMARY

		[minor] Fix ata bug not preserving esi on write.

		Implement allocating a directory/file handle using
		touch or mkdir (fs_api_create) and storing it in the
		HEAD handle (or, the FS root).

		Implement fs_api_nextentry allowing to list directory handles.

		Add oofs_tree class to contain posix directory entries;
		Add oofs_handle, a subclass of oofs_persistence, to mediate
		storage within oofs_alloc managed space.

	NOTE
		The HEAD handle _is_ persisted, but the oofs_alloc handles,
		which also keep track of how much of their space is iniitalized,
		is NOT persisted. The effect of this is that upon reboot,
		the root directory handle (HEAD) is properly read,
		but zeroed out.

		Therefore, To persist directories, call 'oofs /net save 3'
		(if 3 is the index for oofs_alloc).

	NOTE
		'touch /net/foo' will create a directory, not an empty file.
		'mkdir' will do the same. This will be fixed.

	NOTE
		only one directory/file can be created in the root, since
		the structure to contain a filehandle at current is about
		300 bytes, and a second entry will require another sector.
		The saving of the handle does not yet reallocate diskspace.

kernel/ata.s:
	ata_write: preserve esi.

kernel/fs.s:
	increase debug level for keypress.
	fix return error status (CF) on debug.

	export fs_dirent structure constants in declare mode (DEFINE=0).

	fs_nextentry:
	- add disabled error printing after calling fs api
	- use (UN)LOCK_READ_, preserving CF.

	fs_close: don't mfree null label.

kernel/fs/fs_oofs.s:

	implement fs_oofs_create: adds fs_dirent to oofs_tree (alloc.txtab HEAD)

	implement fs_oofs_nextentry: query oofs_tree.

	fs_oofs_open: load root handle.

	implement fs_oofs_close.

kernel/fs/oofs/ClassHierarchy.txt:
	update with new classes.

kernel/fs/oofs/oofs.s:
	include oofs_handle and oofs_tree.

kernel/fs/oofs/oofs_alloc.s:
	update handle_load and export:
	instantiates edx if it is either an oofs_handle or oofs_persistent,
	and initializes it with either the handle or the LBA, size.
	Then proceeds to load.

	txtab_get: delegate instantiation to handle_load.

	handle_save:

	XXX TODO reallocate disk space if object won't fit

	print: print txtab index number (not element offset, also called index).

kernel/fs/oofs/oofs_array.s:
	always load 1 full sector - don't calculate element size.

kernel/fs/oofs/oofs_handle.s: (ADD)
	extends oofs_persistent, and takes both the handle index aswell
	as oofs_alloc, which allows to calculate LBA and size, and
	to override save/load methods and update the initialized size
	on disk in oofs_alloc.

kernel/fs/oofs/oofs_persistent.s:
	write: data exceeds partition message: debug values.

kernel/fs/oofs/oofs_tree.s: (ADD)
	extends oofs_handle; implements directory as an array
	of fs_dirent struct.
	Implements load, save and add.

kernel/fs/oofs/oofs_txtab.s:

	XXX add disabled oofs_txtab_handle field.

	XXX might want to have oofs_txtab extend handle, yet,
	    then it is no longer an array.
	    Perhaps implement multiple inheritance.

kernel/mutex.s:
	add macros (UN)LOCK_READ_ deferring to (UN)LOCK_READ preserving flags.

kernel/oo.s:
	class_invoke_virtual:
	- print class cast exception error, since class_instanceof does not
	  print anything if it returns false.
	- rework callstack to remove the call to class_invoke_virtual so as
	  not to obscure stacktraces.

kernel/shell.s:
	cmd_ls: fs_nextentry may return ZF=1, CF=0 aswell to indicate EOL.
	Typically, ZF and CF used to be equal, however CF is more proper
	to indicate error conditions.
	The change in fs.s is what prompted the modification of shell.s.