[minor] fix task printing label offset limit cond

kernel/schedule.s:
	task_print$: fix some labels that are only used (jumped to) when the
	offset to the label is more than a number of digits.
[minor] breakpoint improvements

kernel/hwdebug.s:
	breakpoint_set_memwrite_dword: preserve eax, ebx.

	all breakpoint methods now first call bp_disabled, which does either
	ret (at current) or int3, in order to track where breakpoints are set
	when debugging the cause of int1.

	debugger interrupt: print the contents of all drX registers.
Add notes on ITC (aka IPC).

DOC/Architecture.txt:
	moved some text to ITC.txt.

DOC/ITC.txt:
	notes on inter-task-communication and some IRC-like trust
	establishment.
[MAJOR] Implement relocatable kernel.

	SUMMARY
	-------

	The kernel now detects whether it is relocated or not and acts
	accordingly.

	Add kernel relocation support in the bootloader.

	Improve memory map management - record the RAMDISK entries more
	accurately and maintain a sorted map.

DOC/Bootsector.txt:
	add notes on bootloader, kernel loading, relocation, ramdisk,
	boot image layout.

Makefile:
	generate kernel files in build/.
	update dependencies.

bootloader/sector1.s:
	handle the relocation ramdisk entry.

	add (disabled) ramdisk_print (unused).

	add sector to ramdisk address even when page aligning, to avoid the
	case where the ramdisk sector is already page aligned, and thus
	gets overwritten.

	add relocate_kernel method, which uses protected mode to relocate
	all 32 bit addresses.

	load_ramdisk_entry: simplify image end address calculation, as page
	alignment will cause miscalculation otherwise.

	protected mode: add stack selector (bootloader stack is at 0000:ffff)
	and preserve ss. Clear fs, gs.

kernel/debugger.s:
	extract memory_map_update_region (to mem.s) from ramdisk_load_image.
	Pass MEMORY_MAP_TYPE_* to ramdisk_load_image.

	debug_printsymbol: the symbol table is not relocated: adjust the
	address if the kernel is relocated.

	debug_assert_array_index: print address of array aswell.

kernel/gdt.s:
	remove macro GDT_STORE_SEG and use GDT_SET_BASE instead.
	update macro GDT_GET_BASE to be usable in 16 bit code, and optimize
	to not use [e]si as intermediate when \sel is a constant.

	Add DT_GET_SEL, DT_GET_OFFSET, and DT_SET_OFFSET. These are meant for
	entries in the IDT and for call gates in the GDT, as the offset is
	stored in the limit field, and the GDT_GET/SET_LIMIT adjusts the value
	according to granularity, which is undesirable.

	init_gdt_16: detect and handle relocation.

		moves the relocation offset into [$reloc], and clears
		[realsegflat] due to relocation.

		update PH_16 macro invocations due to changed signature.

		adjust the segment limits/bases according to relocation. The
		region before the relocation offset will be accessible.
		SEL_realmodeDS will still have the relocation as base,
		but the other segments will have zero-base (if RELOCATION).

		Relocate the kernel call gates (their dword values are
		not stored contiguously).

		lgdt: pm_gdtr is relocated, therefore use ds=0 to load it.
		(another solution is to - .text to disable relocation).

kernel/gfx.s:
	use screen_pos_16.

kernel/idt.s:
	hook_isr: don't sti.

	debug_print_gdt_descriptor: update to print sel/offs of call gates.

	init_idt:
		relocate the static IDT offsets.

		update the address for the IDT - don't add [reloc$] as
		it will be already relocated (IF RELOC).

kernel/kapi.s:
	KAPI_DECLARE: don't subtract .text from method offsets so they
	will be relocated.

	TODO: check if this works without relocation.

kernel/kapi_page_int.s:
	kapi_init_page_int: set the page fault handler offset in a way
	that allows it to be relocated.

	When unknown KAPI method index is called, don't halt but int3
	and print stack info.

kernel/kernel.s:
	update address 0 to 0xcc (int3). (with absolute relocation,
	this will mean that the first byte of the IVT will be overwritten).

kernel/macros.s:
	add macro IS_REG16, used in gdt.s 16 bit macros.

kernel/mem.s:
	mem_init:
		also count/print addressable memory (ACPI dword != 0).

		Fix getting memory base (mem_sel_base).

		Fix adjusting heap: do not decrease the size. The rest is
		mainly printing updates.

	rename print_memory_map to memory_map_print, limit iterations, and add
	memory_map_print_type, using kernel/realmode.s constants.

	add memory_map_update_region, which manages the memory map as a
	consecutive (sorted) compact array. (Code extracted from debugger.s).
	It will now detect identical entries, split entries, and do sorted
	inserts.

	mem_test$: cleanup disabled debug.

	cmd_mem:
		report the relocation table.
		add '-m' option to print the memory map (not the kernel memmap)

kernel/net/net.s:	[TODO: omit in commit]
	net_rx_qt ueue_print: lock the network queue while printing.

	net_rx_queue_print_: if the network queue is unallocated,
	don't print anything (instead of page faulting etc.).

kernel/paging.s:
	add paging_print_pd$ (which does not deference PDE's).

	Clear the page to be used as a page table before identity mapping
	it. (this will only work the first time, before paging is
	enabled; however, the bug remains, since the page table cannot
	be identity mapped in protected mode. This bug is a future TODO,
	and will become an issue when 4Mb of pages is allocated).

kernel/pmode.s:
	handle relocation:
	protected_mode:
		don't adjust reloc$ in relocated mode (init_gdt_16 did this).

		enter pmode using compatCS (don't add reloc$).

		remove untested relocation code (kernel copy).

		initialize the screen variables later, since there now is
		separation between 16bit and 32bit screen management data.

		update the memory map with the kernel and kernel stack.

kernel/print.s:
	move consoles, screen_color, and screen_pos from .data16 to .data.
	The 16-bit code will not access these but will use it's own version.
	This is done, in order to have the screen_update method pointer
	relocatable.

kernel/realmode.s:
	add screen_pos_16 and screen_color_16 in .data16.
	Update the 16-bit print macros to use these.

	swap arguments in the PH8_16 macro, so that it is similar to
	DEBUG_DWORD.

	realmode_kernel_entry:
		take relocation into account for kernel size printing and
		ramdisk analysis (prevent relocation using the -.text method).

kernel/shell.s:	[depends gdt.s]
	add command "idt" and method cmd_print_idt.
	add command "irq" referring to print_irq_handlers.

	cmd_print_gdt: loop through all descriptors and use
	debug_print_gdt_descriptors.

	cmd_print_idt: loop through the idt up to the highest IRQ and
	print the addresses.

kernel/tss.s:
	init_tss16: document relocation for offset default_task.

util/reloc.pl:
	only generate relocation information for .text. Note that the kernel
	is compiled with -R, which folds .data into .text, and thus data
	relocations are done aswell.
Boot image writer fix

util/write.cpp:
	In the case where an image size is a whole number of sectors,
	an empty sector got written, causing mayhem in the bootloader
	ramdisk code.
Implement compressed relocation table.

	SUMMARY

	Implement compressed relocation table, saving (23kb - 6kb).

DOC/Bootsector.txt:
	Document relocation table compression.

Makefile:
	add bootloader phony target for commandline use.

	call util/reloc.pl with -C (compressed) option.

bootloader/bootloader.s:
	remove a few obsolete instructions, compact another instruction, and
	fix a typo. No real change.

bootloader/sector1.s:
	implement compressed relocation table for 32 bit addresses.

	load_ramdisk_fat: use the same code as used to load the ramdisk
	images, which doesn't suffer from improper CHS values.

	drop lba_to_chs_debug and add the debug as compilation-time
	option in lba_to_chs.

util/reloc.pl:
	clobber/truncate the addr16 list to size 0, since it is not used.

	Implement reading/writing compressed addr32 relocation tables.

	The compression ratio for the current kernel is about a factor
	of 3.72, or, 26% original size.