Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ HelenOS.config	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -68,5 +68,4 @@
 % Machine type
 @ "virt" QEMU virt
-@ "hikey960" HiKey 960
 ! [PLATFORM=arm64] MACHINE (choice)
 
@@ -396,7 +395,4 @@
 ! CONFIG_DEBUG (y/n)
 
-% Early debugging print
-! [CONFIG_DEBUG=y] CONFIG_DEBUG_EARLY_PRINT (n/y)
-
 % Sanitize undefined behavior (userspace)
 ! CONFIG_UBSAN (n/y)
@@ -513,5 +509,5 @@
 
 % Support for PL011 UART
-! [CONFIG_HID_OUT=generic|(PLATFORM=arm64&(MACHINE=virt|MACHINE=hikey960))] CONFIG_PL011_UART (y)
+! [CONFIG_HID_OUT=generic|(PLATFORM=arm64&MACHINE=virt)] CONFIG_PL011_UART (y)
 
 % Support for NS16550 controller (kernel console)
@@ -543,5 +539,5 @@
 
 % Support for ARM GICv2
-! [PLATFORM=arm64&(MACHINE=virt|MACHINE=hikey960)] CONFIG_GICV2 (y)
+! [PLATFORM=arm64&MACHINE=virt] CONFIG_GICV2 (y)
 
 % Support for i8042 controller
@@ -616,8 +612,8 @@
 
 % Display double buffering
-! [CONFIG_WINSYS=y] CONFIG_DISP_DOUBLE_BUF (y/n)
+! [CONFIG_FB=y] CONFIG_DISP_DOUBLE_BUF (y/n)
 
 % Client-side UI rendering
-! CONFIG_UI_CS_RENDER (y/n)
+! [CONFIG_FB=y] CONFIG_UI_CS_RENDER (y/n)
 
 % Window double buffering
Index: README.md
===================================================================
--- README.md	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ README.md	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -130,20 +130,4 @@
 see the files in tools/conf.
 
-## Contributing
-
-There is a whole section of our wiki devoted to
-[how to contribute to HelenOS](http://www.helenos.org/wiki/HowToContribute).
-But to highlight the most important points, you should subscribe to
-our mailing list and if you have an idea for contributing, discuss it
-with us first so that we can agree upon the design.
-
-Especially if you are a first time contributor, blindingly shooting
-a pull request may result in it being closed on the grounds that it
-does not fit well within the grand scheme of things. That would not
-be efficient use of time.
-
-Communicating early and often is the key to successful acceptance of
-your patch/PR.
-
 ## License
 
Index: boot/arch/arm64/include/arch/arch.h
===================================================================
--- boot/arch/arm64/include/arch/arch.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ boot/arch/arm64/include/arch/arch.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -41,7 +41,6 @@
 
 #define BOOT_OFFSET  0x80000
-
 #ifndef __ASSEMBLER__
-#define KA2PA(x)  (((uintptr_t) (x)) - UINT64_C(0xffffffff00000000))
+#define KA2PA(x)  (((uintptr_t) (x)) - UINT64_C(0xffffffff80000000))
 #endif
 
Index: boot/arch/arm64/include/arch/barrier.h
===================================================================
--- boot/arch/arm64/include/arch/barrier.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ boot/arch/arm64/include/arch/barrier.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,47 +1,1 @@
-/*
- * Copyright (c) 2015 Petr Pavlu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup boot_arm64
- * @{
- */
-/** @file
- * @brief Memory barriers.
- */
-
-#ifndef BOOT_arm64_BARRIER_H_
-#define BOOT_arm64_BARRIER_H_
-
-#include <stddef.h>
-
-extern void smc_coherence(void *, size_t);
-extern void dcache_flush(void *, size_t);
-
-#endif
-
-/** @}
- */
+../../../../../kernel/arch/arm64/include/arch/barrier.h
Index: boot/arch/arm64/meson.build
===================================================================
--- boot/arch/arm64/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ boot/arch/arm64/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -29,14 +29,7 @@
 BUILD = true
 
-if MACHINE == 'virt'
-	POST_OUTPUT = 'image.iso'
-	POSTBUILD = 'grub'
-	GRUB_LOADER = 'chainloader'
-endif
-
-if MACHINE == 'hikey960'
-	POSTBUILD = 'raw'
-	POST_OUTPUT = 'image.boot'
-endif
+POST_OUTPUT = 'image.iso'
+POSTBUILD = 'grub'
+GRUB_LOADER = 'chainloader'
 
 # Request binary output. The ARM64 port manually prepares the .text
Index: boot/arch/arm64/src/asm.S
===================================================================
--- boot/arch/arm64/src/asm.S	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ boot/arch/arm64/src/asm.S	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -33,6 +33,4 @@
 .section BOOTSTRAP
 
-#define DIRECTORY_ENTRIES 16
-
 /* MS-DOS stub */
 msdos_stub:
@@ -53,8 +51,6 @@
 	.long 0                         /* Number of symbols */
 	.short sec_table - opt_header   /* Size of optional header */
-	/*
-	 * Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE |
-	 *   IMAGE_FILE_LARGE_ADDRESS_AWARE
-	 */
+	/* Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE |
+	 *   IMAGE_FILE_LARGE_ADDRESS_AWARE */
 	.short 0x22
 
@@ -91,9 +87,8 @@
 	.quad 0                         /* Size of heap commit */
 	.long 0                         /* Loader flags */
-	.long DIRECTORY_ENTRIES         /* Number of RVA and sizes */
-	.space DIRECTORY_ENTRIES * 8    /* Directory entries */
+	.long 0                         /* Number of RVA and sizes */
 
 sec_table:
-	.ascii ".text\x0\x0\x0"         /* Name */
+        .ascii ".text\x0\x0\x0"         /* Name */
 	.long payload_end - start       /* Virtual size */
 	.long start - msdos_stub        /* Virtual address */
@@ -104,21 +99,19 @@
 	.short 0                        /* Number of relocations */
 	.short 0                        /* Number of line numbers */
-	/*
-	 * Characteristics = IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE |
-	 *   IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE
-	 */
+	/* Characteristics = IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE |
+	 *   IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE */
 	.long 0xe0000020
 
-/** Boot loader entry point
- *
- * @param x0 UEFI image handle.
- * @param x1 Pointer to the UEFI system table.
- *
- */
 SYMBOL(start)
 	.hidden start
 
 	/*
-	 * Stay on the UEFI stack. Its size is at least 128 KiB, plenty for this
+	 * Parameters:
+	 * x0 is the image handle.
+	 * x1 is a pointer to the UEFI system table.
+	 */
+
+	/*
+	 * Stay on the UEFI stack. Its size is at least 128 kB, plenty for this
 	 * boot loader.
 	 */
@@ -135,13 +128,5 @@
 	add x1, x1, #:lo12:_DYNAMIC
 	bl self_relocate
-	cbnz x0, __uefi_exit
-
-	/*
-	 * Flush the instruction cache of the relocated boot loader image.
-	 */
-	adr x0, msdos_stub
-	adrp x1, payload_end
-	sub x1, x1, x0
-	bl smc_coherence
+	cbnz x0, 0f
 
 	/*
@@ -153,7 +138,7 @@
 	bl bootstrap
 
-	__uefi_exit:
-		ldp x29, x30, [sp], #32
-		ret
+0:
+	ldp x29, x30, [sp], #32
+	ret
 
 FUNCTION_BEGIN(halt)
@@ -163,149 +148,19 @@
 FUNCTION_END(halt)
 
-/** Flush instruction caches
- *
- * @param x0 Starting address of the flushing.
- * @param x1 Number of bytes to flush.
- *
- */
-FUNCTION_BEGIN(smc_coherence)
-	.hidden smc_coherence
-
-	/* Initialize loop */
-	mov x9, x0
-	mov x10, xzr
-
-	__dc_loop:
-		/* Data or Unified Cache Line Clean */
-		dc cvau, x9
-		add x9, x9, #4
-		add x10, x10, #4
-		cmp x10, x1
-		blo __dc_loop
-
-	dsb ish
-
-	/* Initialize loop */
-	mov x9, x0
-	mov x10, xzr
-
-	__ic_loop:
-		/* Instruction Cache Line Invalidate */
-		ic ivau, x9
-		add x9, x9, #4
-		add x10, x10, #4
-		cmp x10, x1
-		blo __ic_loop
-
-	dsb ish
-	isb
-	ret
-FUNCTION_END(smc_coherence)
-
-/** Flush data caches
- *
- * @param x0 Starting address of the flushing.
- * @param x1 Number of bytes to flush.
- *
- */
-FUNCTION_BEGIN(dcache_flush)
-	.hidden dcache_flush
-
-	mov x9, x0
-	mov x10, xzr
-
-	__dc_flush_loop:
-		/* Data or Unified Cache Line Clean */
-		dc cvau, x9
-		add x9, x9, #4
-		add x10, x10, #4
-		cmp x10, x1
-		blo __dc_flush_loop
-
-	dsb ish
-	isb
-	ret
-FUNCTION_END(dcache_flush)
-
-/** Kernel entry
- *
- * @param x0 Kernel entry point.
- * @param x1 Pointer to the bootinfo structure.
- *
- */
 FUNCTION_BEGIN(jump_to_kernel)
 	.hidden jump_to_kernel
 
-	mrs x9, CurrentEL
-	lsr x9, x9, 2
+	/*
+	 * Parameters:
+	 * x0 is kernel entry point.
+	 * x1 is pointer to the bootinfo structure.
+	 */
 
-	cmp x9, #3
-	b.eq __el3
+	/* Disable MMU (removes the identity mapping provided by UEFI). */
+	mrs x2, sctlr_el1
+	bic x2, x2, #SCTLR_M_FLAG
+	msr sctlr_el1, x2
+	isb
 
-	cmp x9, #2
-	b.eq __el2
-
-	cmp x9, #1
-	b.eq __el1
-
-	b halt
-
-	__el3:
-		msr sctlr_el2, xzr
-		msr hcr_el2, xzr
-		isb
-
-		/* EL2 is AArch64, EL1 is Non-secure World */
-		mov x9, #(1 << 10)
-		orr x9, x9, #(1 << 0)
-		msr scr_el3, x9
-		isb
-
-		/* EL2h */
-		mov x9, #0x9
-		msr spsr_el3, x9
-		isb
-
-		adr x9, __el2
-		msr elr_el3, x9
-		isb
-
-		/* Switch to EL2 */
-		eret
-
-	__el2:
-		msr sctlr_el1, xzr
-		isb
-
-		/* EL1 is AArch64 */
-		mov x9, #(1 << 31)
-		msr hcr_el2, x9
-		isb
-
-		/* EL1h */
-		mov x9, #0x5
-		msr spsr_el2, x9
-		isb
-
-		adr x9, __el1
-		msr elr_el2, x9
-		isb
-
-		/* Switch to EL1 */
-		eret
-
-	__el1:
-		/* Do not trap on FPU instructions */
-		mrs x9, cpacr_el1
-		orr x9, x9, #(3 << 20)
-		msr cpacr_el1, x9
-		dmb ish
-
-		/* Disable MMU (removes the identity mapping provided by UEFI) */
-		mrs x9, sctlr_el1
-		bic x9, x9, #SCTLR_M_FLAG
-		msr sctlr_el1, x9
-		isb
-
-		br x0
+	br x0
 FUNCTION_END(jump_to_kernel)
Index: boot/arch/arm64/src/main.c
===================================================================
--- boot/arch/arm64/src/main.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ boot/arch/arm64/src/main.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -116,4 +116,5 @@
 {
 	efi_status_t status;
+	uint64_t current_el;
 	uint64_t memmap = 0;
 	sysarg_t memmap_size;
@@ -142,4 +143,13 @@
 	printf(" %p|%p: UEFI system table\n", efi_system_table_in,
 	    efi_system_table_in);
+
+	/* Validate the exception level. */
+	current_el = CurrentEL_read();
+	if (current_el != CURRENT_EL_EL1) {
+		printf("Error: Unexpected CurrentEL value %0#18" PRIx64 ".\n",
+		    current_el);
+		status = EFI_UNSUPPORTED;
+		goto fail;
+	}
 
 	/* Obtain memory map. */
@@ -177,5 +187,5 @@
 
 	/*
-	 * Check that everything is aligned on a 4 KiB boundary and the kernel can
+	 * Check that everything is aligned on a 4kB boundary and the kernel can
 	 * be placed by the decompression code at a correct address.
 	 */
@@ -189,9 +199,9 @@
 	 * Dynamically check the memory base. The condition should be always
 	 * true because UEFI guarantees each physical/virtual address in the
-	 * memory map is aligned on a 4 KiB boundary.
+	 * memory map is aligned on a 4kB boundary.
 	 */
 	if (!IS_ALIGNED(memory_base, PAGE_SIZE)) {
 		printf("Error: Start of usable RAM (%p) is not aligned on a "
-		    "4 KiB boundary.\n", (void *) memory_base);
+		    "4kB boundary.\n", (void *) memory_base);
 		status = EFI_UNSUPPORTED;
 		goto fail;
@@ -233,5 +243,5 @@
 
 	extract_payload(&bootinfo->taskmap, kernel_dest, ram_end,
-	    (uintptr_t) kernel_dest, smc_coherence);
+	    (uintptr_t) kernel_dest, ensure_visibility);
 
 	/* Get final memory map. */
@@ -291,7 +301,4 @@
 	bootinfo->memmap.cnt = cnt;
 
-	/* Flush the data cache containing bootinfo. */
-	dcache_flush(bootinfo, sizeof(*bootinfo));
-
 	uintptr_t entry = check_kernel_translated((void *) decompress_base,
 	    BOOT_OFFSET);
Index: faults/arm64/hikey960/Makefile.config
===================================================================
--- defaults/arm64/hikey960/Makefile.config	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,2 +1,0 @@
-# Machine type
-MACHINE = hikey960
Index: faults/arm64/hikey960/output
===================================================================
--- defaults/arm64/hikey960/output	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,1 +1,0 @@
-image.boot
Index: defaults/arm64/output
===================================================================
--- defaults/arm64/output	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
+++ defaults/arm64/output	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -0,0 +1,1 @@
+image.iso
Index: faults/arm64/virt/output
===================================================================
--- defaults/arm64/virt/output	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,1 +1,0 @@
-image.iso
Index: kernel/arch/amd64/src/amd64.c
===================================================================
--- kernel/arch/amd64/src/amd64.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/amd64/src/amd64.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -224,6 +224,4 @@
 	    ns16550_out_ptr);
 	if (ns16550_instance) {
-		ns16550_format_set(ns16550_instance, 38400,
-		    LCR_PARITY_NONE | LCR_STOP_BIT_TWO | LCR_WORD_LEN_8);
 #ifdef CONFIG_NS16550
 		srln_instance_t *srln_instance = srln_init();
Index: kernel/arch/amd64/src/asm.S
===================================================================
--- kernel/arch/amd64/src/asm.S	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/amd64/src/asm.S	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -411,6 +411,4 @@
 FUNCTION_BEGIN(early_putuchar)
 
-#if (defined(CONFIG_DEBUG_EARLY_PRINT))
-
 #if (defined(CONFIG_L4RE_UVMM_EARLY_PRINT))
 	xorl %eax, %eax  /* RAX==0: uvmm's print hypercall */
@@ -545,6 +543,4 @@
 #endif
 
-#endif
-
 	ret
 FUNCTION_END(early_putuchar)
Index: kernel/arch/arm32/include/arch/mm/page.h
===================================================================
--- kernel/arch/arm32/include/arch/mm/page.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm32/include/arch/mm/page.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -159,7 +159,4 @@
 #endif
 	TTBR0_write(val);
-#if defined(PROCESSOR_ARCH_armv6) || defined(PROCESSOR_ARCH_armv7_a)
-	BPIALL_write(0);
-#endif
 }
 
Index: kernel/arch/arm32/src/cpu/cpu.c
===================================================================
--- kernel/arch/arm32/src/cpu/cpu.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm32/src/cpu/cpu.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -170,4 +170,6 @@
 	 */
 	control_reg |= SCTLR_CACHE_EN_FLAG;
+#endif
+#ifdef PROCESSOR_ARCH_armv7_a
 	/*
 	 * ICache coherency is elaborated on in barrier.h.
Index: kernel/arch/arm32/src/mach/raspberrypi/raspberrypi.c
===================================================================
--- kernel/arch/arm32/src/mach/raspberrypi/raspberrypi.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm32/src/mach/raspberrypi/raspberrypi.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -174,13 +174,6 @@
 {
 #ifdef CONFIG_FB
-	uint32_t width, height;
 	fb_properties_t prop;
-
-	if (!bcm2835_mbox_get_fb_size(&width, &height)) {
-		printf("mbox: could not get the framebuffer size\n");
-		width = 640;
-		height = 480;
-	}
-	if (bcm2835_fb_init(&prop, width, height)) {
+	if (bcm2835_fb_init(&prop)) {
 		outdev_t *fb_dev = fb_init(&prop);
 		if (fb_dev)
Index: kernel/arch/arm64/include/arch/barrier.h
===================================================================
--- kernel/arch/arm64/include/arch/barrier.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/include/arch/barrier.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -37,4 +37,44 @@
 #define KERN_arm64_BARRIER_H_
 
+#include <stddef.h>
+
+#define COHERENCE_INVAL_MIN  4
+
+/** Ensure visibility of instruction updates for a multiprocessor.
+ *
+ * @param addr Address of the first instruction.
+ * @param size Size of the instruction block (in bytes).
+ */
+static inline void ensure_visibility(void *addr, size_t len)
+{
+	size_t i;
+
+	/*
+	 * Clean to Point of Unification to make the new instructions visible to
+	 * the instruction cache.
+	 */
+	for (i = 0; i < len; i += COHERENCE_INVAL_MIN)
+		asm volatile (
+		    "dc cvau, %[addr]\n"
+		    : : [addr] "r" ((char *) addr + i)
+		);
+
+	/* Ensure completion on all PEs. */
+	asm volatile ("dsb ish" ::: "memory");
+
+	/* Ensure instruction cache/branch predictor discards stale data. */
+	for (i = 0; i < len; i += COHERENCE_INVAL_MIN)
+		asm volatile (
+		    "ic ivau, %[addr]\n"
+		    : : [addr] "r" ((char *) addr + i)
+		);
+
+	/* Ensure completion on all PEs. */
+	asm volatile ("dsb ish" ::: "memory");
+
+	/* Synchronize context on this PE. */
+	asm volatile ("isb");
+}
+
 #endif
 
Index: kernel/arch/arm64/include/arch/istate_struct.h
===================================================================
--- kernel/arch/arm64/include/arch/istate_struct.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/include/arch/istate_struct.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -65,6 +65,5 @@
 #define ISTATE_OFFSET_X29    0x108
 #define ISTATE_OFFSET_X30    0x110
-#define ISTATE_OFFSET_PAD0   0x118
-#define ISTATE_SIZE          0x120
+#define ISTATE_SIZE          0x118
 
 #ifndef __ASSEMBLER__
@@ -110,15 +109,6 @@
 	/* Link Register. */
 	uint64_t x30;
-
-	/*
-	 * ARM64 mandates that the stack pointer is always aligned to
-	 * a 16-byte boundary. To satisfy this condition, the size of
-	 * this data structure needs to be also a multiple of 16 bytes.
-	 * This is the reason for this padding.
-	 */
-	uint64_t pad0;
 } istate_t;
 
 #endif
-
 #endif
Index: rnel/arch/arm64/include/arch/mach/hikey960/hikey960.h
===================================================================
--- kernel/arch/arm64/include/arch/mach/hikey960/hikey960.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2021 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kernel_arm64_hikey960
- * @brief HiKey 960 platform.
- * @ingroup kernel_arm64
- * @{
- */
-/** @file
- * @brief HiKey 960 platform driver.
- */
-
-#ifndef KERN_arm64_mach_hikey960_H_
-#define KERN_arm64_mach_hikey960_H_
-
-#include <arch/machine_func.h>
-
-extern struct arm_machine_ops hikey960_machine_ops;
-
-#endif
-
-/** @}
- */
Index: kernel/arch/arm64/include/arch/mach/virt/virt.h
===================================================================
--- kernel/arch/arm64/include/arch/mach/virt/virt.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/include/arch/mach/virt/virt.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -36,6 +36,6 @@
  */
 
-#ifndef KERN_arm64_mach_virt_H_
-#define KERN_arm64_mach_virt_H_
+#ifndef KERN_arm64_virt_H_
+#define KERN_arm64_virt_H_
 
 #include <arch/machine_func.h>
Index: kernel/arch/arm64/include/arch/machine_func.h
===================================================================
--- kernel/arch/arm64/include/arch/machine_func.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/include/arch/machine_func.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -50,5 +50,4 @@
 	size_t (*machine_get_irq_count)(void);
 	const char *(*machine_get_platform_name)(void);
-	void (*machine_early_uart_output)(char32_t);
 };
 
@@ -61,5 +60,4 @@
 extern size_t machine_get_irq_count(void);
 extern const char *machine_get_platform_name(void);
-extern void machine_early_uart_output(char32_t);
 
 #endif
Index: kernel/arch/arm64/include/arch/mm/km.h
===================================================================
--- kernel/arch/arm64/include/arch/mm/km.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/include/arch/mm/km.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -41,9 +41,9 @@
 #include <typedefs.h>
 
-#define KM_ARM64_IDENTITY_START  UINT64_C(0xffffffff00000000)
-#define KM_ARM64_IDENTITY_SIZE   UINT64_C(0x0000000100000000)
+#define KM_ARM64_IDENTITY_START  UINT64_C(0xffffffff80000000)
+#define KM_ARM64_IDENTITY_SIZE   UINT64_C(0x0000000080000000)
 
 #define KM_ARM64_NON_IDENTITY_START  UINT64_C(0xffff000000000000)
-#define KM_ARM64_NON_IDENTITY_SIZE   UINT64_C(0x0000ffff00000000)
+#define KM_ARM64_NON_IDENTITY_SIZE   UINT64_C(0x0000ffff80000000)
 
 extern void km_identity_arch_init(void);
@@ -53,9 +53,9 @@
 #else /* __ASSEMBLER__ */
 
-#define KM_ARM64_IDENTITY_START  0xffffffff00000000
-#define KM_ARM64_IDENTITY_SIZE   0x0000000100000000
+#define KM_ARM64_IDENTITY_START  0xffffffff80000000
+#define KM_ARM64_IDENTITY_SIZE   0x0000000080000000
 
 #define KM_ARM64_NON_IDENTITY_START  0xffff000000000000
-#define KM_ARM64_NON_IDENTITY_SIZE   0x0000ffff00000000
+#define KM_ARM64_NON_IDENTITY_SIZE   0x0000ffff80000000
 
 #endif /* __ASSEMBLER__ */
Index: kernel/arch/arm64/include/arch/mm/page.h
===================================================================
--- kernel/arch/arm64/include/arch/mm/page.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/include/arch/mm/page.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -53,7 +53,7 @@
 
 #define KA2PA(x) \
-	(((uintptr_t) (x)) - UINT64_C(0xffffffff00000000) + physmem_base)
+	(((uintptr_t) (x)) - UINT64_C(0xffffffff80000000) + physmem_base)
 #define PA2KA(x) \
-	(((uintptr_t) (x)) + UINT64_C(0xffffffff00000000) - physmem_base)
+	(((uintptr_t) (x)) + UINT64_C(0xffffffff80000000) - physmem_base)
 
 #endif /* __ASSEMBLER__ */
Index: kernel/arch/arm64/meson.build
===================================================================
--- kernel/arch/arm64/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -44,4 +44,5 @@
 	'src/mm/page.c',
 	'src/mm/tlb.c',
+	'src/smc.c',
 	'src/smp/ipi.c',
 	'src/smp/smp.c',
@@ -51,8 +52,4 @@
 if MACHINE == 'virt'
 	arch_src += files('src/mach/virt/virt.c')
-endif
-
-if MACHINE == 'hikey960'
-	arch_src += files('src/mach/hikey960/hikey960.c')
 endif
 
Index: kernel/arch/arm64/src/arm64.c
===================================================================
--- kernel/arch/arm64/src/arm64.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/src/arm64.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -40,5 +40,4 @@
 #include <arch/exception.h>
 #include <arch/machine_func.h>
-#include <console/console.h>
 #include <interrupt.h>
 #include <proc/scheduler.h>
@@ -257,14 +256,4 @@
 }
 
-void early_putuchar(char32_t c)
-{
-#ifdef CONFIG_DEBUG_EARLY_PRINT
-	if (c == '\n')
-		machine_early_uart_output('\r');
-
-	machine_early_uart_output(c);
-#endif
-}
-
 /** @}
  */
Index: kernel/arch/arm64/src/asm.S
===================================================================
--- kernel/arch/arm64/src/asm.S	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/src/asm.S	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -56,41 +56,7 @@
 FUNCTION_END(memcpy_to_uspace_failover_address)
 
-/** Flush instruction caches
- *
- * @param x0 Starting address of the flushing.
- * @param x1 Number of bytes to flush.
- *
- */
-FUNCTION_BEGIN(smc_coherence)
-	/* Initialize loop */
-	mov x9, x0
-	mov x10, xzr
-
-	__dc_loop:
-		/* Data or Unified Cache Line Clean */
-		dc cvau, x9
-		add x9, x9, #4
-		add x10, x10, #4
-		cmp x10, x1
-		blo __dc_loop
-
-	dsb ish
-
-	/* Initialize loop */
-	mov x9, x0
-	mov x10, xzr
-
-	__ic_loop:
-		/* Instruction Cache Line Invalidate */
-		ic ivau, x9
-		add x9, x9, #4
-		add x10, x10, #4
-		cmp x10, x1
-		blo __ic_loop
-
-	dsb ish
-	isb
+FUNCTION_BEGIN(early_putuchar)
 	ret
-FUNCTION_END(smc_coherence)
+FUNCTION_END(early_putuchar)
 
 /* Static checks for the istate_t save/load. */
Index: rnel/arch/arm64/src/mach/hikey960/hikey960.c
===================================================================
--- kernel/arch/arm64/src/mach/hikey960/hikey960.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,149 +1,0 @@
-/*
- * Copyright (c) 2021 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kernel_arm64_hikey960
- * @{
- */
-/** @file
- * @brief HiKey 960 platform driver.
- */
-
-#include <arch/mach/hikey960/hikey960.h>
-#include <console/console.h>
-#include <genarch/drivers/gicv2/gicv2.h>
-#include <genarch/drivers/pl011/pl011.h>
-#include <genarch/srln/srln.h>
-#include <mm/km.h>
-#include <sysinfo/sysinfo.h>
-
-#define HIKEY960_VTIMER_IRQ         27
-#define HIKEY960_UART_IRQ           111
-#define HIKEY960_GIC_DISTR_ADDRESS  0xE82B1000
-#define HIKEY960_GIC_CPUI_ADDRESS   0xE82B2000
-#define HIKEY960_UART_ADDRESS       0xFFF32000
-
-struct {
-	gicv2_t gicv2;
-	pl011_uart_t uart;
-} hikey960;
-
-static void hikey960_init(void)
-{
-	/* Initialize interrupt controller. */
-	gicv2_distr_regs_t *distr = (void *) km_map(HIKEY960_GIC_DISTR_ADDRESS,
-	    ALIGN_UP(sizeof(*distr), PAGE_SIZE), KM_NATURAL_ALIGNMENT,
-	    PAGE_NOT_CACHEABLE | PAGE_READ | PAGE_WRITE | PAGE_KERNEL);
-	gicv2_cpui_regs_t *cpui = (void *) km_map(HIKEY960_GIC_CPUI_ADDRESS,
-	    ALIGN_UP(sizeof(*cpui), PAGE_SIZE), KM_NATURAL_ALIGNMENT,
-	    PAGE_NOT_CACHEABLE | PAGE_READ | PAGE_WRITE | PAGE_KERNEL);
-	gicv2_init(&hikey960.gicv2, distr, cpui);
-}
-
-static void hikey960_irq_exception(unsigned int exc_no, istate_t *istate)
-{
-	unsigned int inum, cpuid;
-	gicv2_inum_get(&hikey960.gicv2, &inum, &cpuid);
-
-	/* Dispatch the interrupt. */
-	irq_t *irq = irq_dispatch_and_lock(inum);
-	if (irq) {
-		/* The IRQ handler was found. */
-		irq->handler(irq);
-		irq_spinlock_unlock(&irq->lock, false);
-	} else {
-		/* Spurious interrupt. */
-		printf("cpu%d: spurious interrupt (inum=%u)\n", CPU->id, inum);
-	}
-
-	/* Signal end of interrupt to the controller. */
-	gicv2_end(&hikey960.gicv2, inum, cpuid);
-}
-
-static void hikey960_output_init(void)
-{
-	if (!pl011_uart_init(&hikey960.uart, HIKEY960_UART_IRQ,
-	    HIKEY960_UART_ADDRESS))
-		return;
-
-	stdout_wire(&hikey960.uart.outdev);
-}
-
-static void hikey960_input_init(void)
-{
-	srln_instance_t *srln_instance = srln_init();
-	if (srln_instance == NULL)
-		return;
-
-	indev_t *sink = stdin_wire();
-	indev_t *srln = srln_wire(srln_instance, sink);
-	pl011_uart_input_wire(&hikey960.uart, srln);
-	gicv2_enable(&hikey960.gicv2, HIKEY960_UART_IRQ);
-}
-
-static inr_t hikey960_enable_vtimer_irq(void)
-{
-	gicv2_enable(&hikey960.gicv2, HIKEY960_VTIMER_IRQ);
-	return HIKEY960_VTIMER_IRQ;
-}
-
-static size_t hikey960_get_irq_count(void)
-{
-	return gicv2_inum_get_total(&hikey960.gicv2);
-}
-
-static const char *hikey960_get_platform_name(void)
-{
-	return "hikey960";
-}
-
-static void hikey960_early_uart_output(char32_t c)
-{
-	volatile uint32_t *uartdr = (volatile uint32_t *)
-	    PA2KA(HIKEY960_UART_ADDRESS);
-	volatile uint32_t *uartfr = (volatile uint32_t *)
-	    PA2KA(HIKEY960_UART_ADDRESS + 24);
-
-	while (*uartfr & 0x20U) {
-	}
-
-	*uartdr = c;
-}
-
-struct arm_machine_ops hikey960_machine_ops = {
-	hikey960_init,
-	hikey960_irq_exception,
-	hikey960_output_init,
-	hikey960_input_init,
-	hikey960_enable_vtimer_irq,
-	hikey960_get_irq_count,
-	hikey960_get_platform_name,
-	hikey960_early_uart_output
-};
-
-/** @}
- */
Index: kernel/arch/arm64/src/machine_func.c
===================================================================
--- kernel/arch/arm64/src/machine_func.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/src/machine_func.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -37,5 +37,4 @@
 
 #include <arch/machine_func.h>
-#include <arch/mach/hikey960/hikey960.h>
 #include <arch/mach/virt/virt.h>
 
@@ -48,6 +47,4 @@
 #if defined(MACHINE_virt)
 	machine_ops = &virt_machine_ops;
-#elif defined(MACHINE_hikey960)
-	machine_ops = &hikey960_machine_ops;
 #else
 #error Machine type not defined.
@@ -101,11 +98,4 @@
 }
 
-/** Early debugging output. */
-void machine_early_uart_output(char32_t c)
-{
-	if (machine_ops->machine_early_uart_output != NULL)
-		machine_ops->machine_early_uart_output(c);
-}
-
 /** @}
  */
Index: kernel/arch/arm64/src/smc.c
===================================================================
--- kernel/arch/arm64/src/smc.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
+++ kernel/arch/arm64/src/smc.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019 Petr Pavlu
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <arch/barrier.h>
+#include <barrier.h>
+
+void smc_coherence(void *a, size_t l)
+{
+	ensure_visibility(a, l);
+}
Index: kernel/arch/arm64/src/start.S
===================================================================
--- kernel/arch/arm64/src/start.S	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/arm64/src/start.S	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -35,40 +35,21 @@
 .section K_TEXT_START, "ax"
 
-.macro dcache_flush addr size temp0 temp1
-	mov \temp0, \addr
-	mov \temp1, xzr
-
-	0:
-		/* Data or Unified Cache Line Clean */
-		dc cvau, \temp0
-		add \temp0, \temp0, #4
-		add \temp1, \temp1, #4
-		cmp \temp1, \size
-		blo 0b
-
-	dsb ish
-	isb
-.endm
-
-/** Kernel entry
- *
- * MMU must be disabled at this point.
- *
- * @param x0 Kernel entry point (kernel_image_start).
- * @param x1 Pointer to the bootinfo structure.
- *
- */
 SYMBOL(kernel_image_start)
+	/*
+	 * Parameters:
+	 * x0 is kernel entry point (kernel_image_start).
+	 * x1 is pointer to the bootinfo structure.
+	 *
+	 * MMU must be disabled at this point.
+	 */
+
 	/* Get address of the main memory and remember it. */
 	adrp x20, kernel_image_start - BOOT_OFFSET
 	adrp x2, physmem_base
+	/* add x2, x2, #:lo12:physmem_base */
 	str x20, [x2]
 
-	/* Flush the data cache of physmem_base. */
-	mov x28, #8
-	dcache_flush x2 x28 x29 x30
-
-	/*
-	 * Set up address translation that identity maps the 1 GiB area that
+	/*
+	 * Set up address translation that identity maps the gigabyte area that
 	 * is holding the current execution page.
 	 */
@@ -95,5 +76,5 @@
 	mov x3, #( \
 	    1 << PTE_ACCESS_SHIFT | \
-	    MAIR_EL1_NORMAL_MEMORY_INDEX << PTE_ATTR_INDEX_SHIFT | \
+	    MAIR_EL1_DEVICE_MEMORY_INDEX << PTE_ATTR_INDEX_SHIFT | \
 	    PTE_L012_TYPE_BLOCK << PTE_TYPE_SHIFT | \
 	    1 << PTE_PRESENT_SHIFT)
@@ -103,11 +84,10 @@
 
 	/*
-	 * Set up address translation that maps the first 4 GiB of the kernel
-	 * identity virtual address space to the first 4 GiB of the physical
+	 * Set up address translation that maps the first gigabyte of the kernel
+	 * identity virtual address space to the first gigabyte of the physical
 	 * memory.
 	 */
 
 	mov x21, #KM_ARM64_IDENTITY_START
-	ldr x22, =(1024 * 1024 * 1024)
 
 	/* Prepare the level 0 page table. */
@@ -132,5 +112,5 @@
 	mov x3, #( \
 	    1 << PTE_ACCESS_SHIFT | \
-	    MAIR_EL1_NORMAL_MEMORY_INDEX << PTE_ATTR_INDEX_SHIFT | \
+	    MAIR_EL1_DEVICE_MEMORY_INDEX << PTE_ATTR_INDEX_SHIFT | \
 	    PTE_L012_TYPE_BLOCK << PTE_TYPE_SHIFT | \
 	    1 << PTE_PRESENT_SHIFT)
@@ -138,72 +118,4 @@
 	orr x3, x3, x4, lsl #PTE_OUTPUT_ADDRESS_SHIFT
 	str x3, [x2]
-
-	/* 2nd GiB */
-	add x23, x20, x22
-	add x24, x21, x22
-
-	adrp x2, upper_page_table_level1
-	lsr x3, x24, #PTL1_VA_SHIFT
-	and x3, x3, #PTL1_VA_MASK
-	add x2, x2, x3, lsl #PTL_ENTRY_SIZE_SHIFT
-	mov x3, #( \
-	    1 << PTE_ACCESS_SHIFT | \
-	    MAIR_EL1_NORMAL_MEMORY_INDEX << PTE_ATTR_INDEX_SHIFT | \
-	    PTE_L012_TYPE_BLOCK << PTE_TYPE_SHIFT | \
-	    1 << PTE_PRESENT_SHIFT)
-	lsr x4, x23, #FRAME_WIDTH
-	orr x3, x3, x4, lsl #PTE_OUTPUT_ADDRESS_SHIFT
-	str x3, [x2]
-
-	/* 3rd GiB */
-	add x23, x23, x22
-	add x24, x24, x22
-
-	adrp x2, upper_page_table_level1
-	lsr x3, x24, #PTL1_VA_SHIFT
-	and x3, x3, #PTL1_VA_MASK
-	add x2, x2, x3, lsl #PTL_ENTRY_SIZE_SHIFT
-	mov x3, #( \
-	    1 << PTE_ACCESS_SHIFT | \
-	    MAIR_EL1_NORMAL_MEMORY_INDEX << PTE_ATTR_INDEX_SHIFT | \
-	    PTE_L012_TYPE_BLOCK << PTE_TYPE_SHIFT | \
-	    1 << PTE_PRESENT_SHIFT)
-	lsr x4, x23, #FRAME_WIDTH
-	orr x3, x3, x4, lsl #PTE_OUTPUT_ADDRESS_SHIFT
-	str x3, [x2]
-
-	/* 4th GiB */
-	add x23, x23, x22
-	add x24, x24, x22
-
-	adrp x2, upper_page_table_level1
-	lsr x3, x24, #PTL1_VA_SHIFT
-	and x3, x3, #PTL1_VA_MASK
-	add x2, x2, x3, lsl #PTL_ENTRY_SIZE_SHIFT
-	mov x3, #( \
-	    1 << PTE_ACCESS_SHIFT | \
-	    MAIR_EL1_DEVICE_MEMORY_INDEX << PTE_ATTR_INDEX_SHIFT | \
-	    PTE_L012_TYPE_BLOCK << PTE_TYPE_SHIFT | \
-	    1 << PTE_PRESENT_SHIFT)
-	lsr x4, x23, #FRAME_WIDTH
-	orr x3, x3, x4, lsl #PTE_OUTPUT_ADDRESS_SHIFT
-	str x3, [x2]
-
-	/* Flush the data cache of page tables. */
-	adrp x27, lower_page_table_level0
-	mov x28, #4096
-	dcache_flush x27 x28 x29 x30
-
-	adrp x27, lower_page_table_level1
-	mov x28, #4096
-	dcache_flush x27 x28 x29 x30
-
-	adrp x27, upper_page_table_level0
-	mov x28, #4096
-	dcache_flush x27 x28 x29 x30
-
-	adrp x27, upper_page_table_level1
-	mov x28, #4096
-	dcache_flush x27 x28 x29 x30
 
 	/* Make sure there are not any stale TLB entries. */
@@ -359,11 +271,8 @@
 lower_page_table_level0:
 	.space 4096
-
 lower_page_table_level1:
 	.space 4096
-
 upper_page_table_level0:
 	.space 4096
-
 upper_page_table_level1:
 	.space 4096
Index: kernel/arch/ia32/src/asm.S
===================================================================
--- kernel/arch/ia32/src/asm.S	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/ia32/src/asm.S	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -453,5 +453,5 @@
 FUNCTION_BEGIN(early_putuchar)
 
-#if ((defined(CONFIG_DEBUG_EARLY_PRINT)) && (defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
+#if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
 
 	/* Prologue, save preserved registers */
Index: kernel/arch/ia32/src/ia32.c
===================================================================
--- kernel/arch/ia32/src/ia32.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/ia32/src/ia32.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -209,6 +209,4 @@
 	    ns16550_out_ptr);
 	if (ns16550_instance) {
-		ns16550_format_set(ns16550_instance, 38400,
-		    LCR_PARITY_NONE | LCR_STOP_BIT_TWO | LCR_WORD_LEN_8);
 #ifdef CONFIG_NS16550
 		srln_instance_t *srln_instance = srln_init();
Index: kernel/arch/sparc64/include/arch/sun4v/cpu.h
===================================================================
--- kernel/arch/sparc64/include/arch/sun4v/cpu.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/arch/sparc64/include/arch/sun4v/cpu.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -54,5 +54,5 @@
 	uint64_t cpuids[MAX_CORE_STRANDS];
 	struct cpu *cpus[MAX_CORE_STRANDS];
-	atomic_size_t nrdy;
+	atomic_t nrdy;
 	SPINLOCK_DECLARE(proposed_nrdy_lock);
 } exec_unit_t;
Index: kernel/genarch/include/genarch/drivers/bcm2835/mbox.h
===================================================================
--- kernel/genarch/include/genarch/drivers/bcm2835/mbox.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/genarch/include/genarch/drivers/bcm2835/mbox.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -68,11 +68,4 @@
 
 enum {
-	MBOX_TAG_GET_PHYS_W_H	= 0x00040003,
-	MBOX_TAG_SET_PHYS_W_H	= 0x00048003,
-	MBOX_TAG_GET_VIRT_W_H	= 0x00040004,
-	MBOX_TAG_SET_VIRT_W_G	= 0x00048004
-};
-
-enum {
 	MBOX_PROP_CODE_REQ	= 0x00000000,
 	MBOX_PROP_CODE_RESP_OK	= 0x80000000,
@@ -129,14 +122,4 @@
 
 typedef struct {
-	mbox_prop_buf_hdr_t	buf_hdr;
-	mbox_tag_hdr_t		tag_hdr;
-	struct {
-		uint32_t	width;
-		uint32_t	height;
-	} body;
-	uint32_t zero;
-} mbox_getfbsize_buf_t;
-
-typedef struct {
 	ioport32_t width;
 	ioport32_t height;
@@ -152,6 +135,5 @@
 
 extern bool bcm2835_prop_get_memory(uint32_t *base, uint32_t *size);
-extern bool bcm2835_fb_init(fb_properties_t *prop, uint32_t width, uint32_t heigth);
-extern bool bcm2835_mbox_get_fb_size(uint32_t *h, uint32_t *w);
+extern bool bcm2835_fb_init(fb_properties_t *prop);
 
 #endif
Index: kernel/genarch/include/genarch/drivers/ns16550/ns16550.h
===================================================================
--- kernel/genarch/include/genarch/drivers/ns16550/ns16550.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/genarch/include/genarch/drivers/ns16550/ns16550.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -43,25 +43,9 @@
 #include <console/chardev.h>
 
-#define NS156440_CLOCK    115200 /** Internal clock speed, max. baud rate. */
+#define IER_ERBFI  0x01  /** Enable Receive Buffer Full Interrupt. */
 
-#define IER_ERBFI         0x01   /** Enable Receive Buffer Full Interrupt. */
-#define MCR_OUT2          0x08   /** OUT2. */
+#define LCR_DLAB   0x80  /** Divisor Latch Access bit. */
 
-#define LCR_DLAB          0x80   /** Divisor Latch Access bit. */
-#define LCR_SBE           0x40   /** RS-232 Break Signal bit. */
-
-#define LCR_PARITY_NONE   0x00   /** No parity bit. */
-#define LCR_PARITY_ODD    0x08   /** Odd parity. */
-#define LCR_PARITY_EVEN   0x18   /** Even parity. */
-#define LCR_PARITY_MARK   0x28   /** Parity bit always one. */
-#define LCR_PARITY_SPACE  0x38   /** Parity bit always zero. */
-
-#define LCR_STOP_BIT_ONE  0x00   /** One stop bit. */
-#define LCR_STOP_BIT_TWO  0x04   /** Two stop bits. */
-
-#define LCR_WORD_LEN_5    0x00   /** 5-bit word length. */
-#define LCR_WORD_LEN_6    0x01   /** 6-bit word length. */
-#define LCR_WORD_LEN_7    0x02   /** 7-bit word length. */
-#define LCR_WORD_LEN_8    0x03   /** 8-bit word length. */
+#define MCR_OUT2   0x08  /** OUT2. */
 
 /** NS16550 registers. */
@@ -69,7 +53,5 @@
 	NS16550_REG_RBR = 0,  /**< Receiver Buffer Register (read). */
 	NS16550_REG_THR = 0,  /**< Transmitter Holder Register (write). */
-	NS16550_REG_DLL = 0,  /**< Baud rate divisor latch low byte (write). */
 	NS16550_REG_IER = 1,  /**< Interrupt Enable Register. */
-	NS16550_REG_DLH = 1,  /**< Baud rate divisor latch high byte (write). */
 	NS16550_REG_IIR = 2,  /**< Interrupt Ident Register (read). */
 	NS16550_REG_FCR = 2,  /**< FIFO control register (write). */
@@ -91,5 +73,4 @@
 extern ns16550_instance_t *ns16550_init(ioport8_t *, unsigned, inr_t, cir_t,
     void *, outdev_t **);
-extern void ns16550_format_set(ns16550_instance_t *, unsigned, uint8_t);
 extern void ns16550_wire(ns16550_instance_t *, indev_t *);
 
Index: kernel/genarch/src/drivers/bcm2835/mbox.c
===================================================================
--- kernel/genarch/src/drivers/bcm2835/mbox.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/genarch/src/drivers/bcm2835/mbox.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -86,5 +86,5 @@
 }
 
-bool bcm2835_fb_init(fb_properties_t *prop, uint32_t width, uint32_t height)
+bool bcm2835_fb_init(fb_properties_t *prop)
 {
 	bcm2835_mbox_t *fb_mbox;
@@ -95,6 +95,6 @@
 	    KM_NATURAL_ALIGNMENT, PAGE_NOT_CACHEABLE);
 
-	fb_desc->width = width;
-	fb_desc->height = height;
+	fb_desc->width = 640;
+	fb_desc->height = 480;
 	fb_desc->virt_width = fb_desc->width;
 	fb_desc->virt_height = fb_desc->height;
@@ -128,35 +128,4 @@
 }
 
-bool bcm2835_mbox_get_fb_size(uint32_t *w, uint32_t *h)
-{
-	bool r;
-	MBOX_BUFF_ALLOC(msg, mbox_getfbsize_buf_t);
-	bcm2835_mbox_t *mbox;
-
-	mbox = (void *) km_map(BCM2835_MBOX0_ADDR, sizeof(bcm2835_mbox_t),
-	    KM_NATURAL_ALIGNMENT, PAGE_NOT_CACHEABLE);
-	assert(mbox);
-
-	msg->buf_hdr.size = sizeof(mbox_getfbsize_buf_t);
-	msg->buf_hdr.code = MBOX_PROP_CODE_REQ;
-	msg->tag_hdr.tag_id = MBOX_TAG_GET_PHYS_W_H;
-	msg->tag_hdr.buf_size = sizeof(msg->body);
-	msg->tag_hdr.val_len  = 0;
-	msg->zero = 0;
-
-	mbox_write(mbox,
-	    MBOX_CHAN_PROP_A2V, KA2VCA((uint32_t)msg));
-	mbox_read(mbox, MBOX_CHAN_PROP_A2V);
-
-	r = msg->buf_hdr.code == MBOX_PROP_CODE_RESP_OK;
-	if (r) {
-		*h = msg->body.height;
-		*w = msg->body.width;
-	}
-
-	km_unmap((uintptr_t) mbox, sizeof(bcm2835_mbox_t));
-	return r;
-}
-
 /**
  * @}
Index: kernel/genarch/src/drivers/ns16550/ns16550.c
===================================================================
--- kernel/genarch/src/drivers/ns16550/ns16550.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/genarch/src/drivers/ns16550/ns16550.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -132,28 +132,4 @@
 };
 
-/** Configure ns16550 transmission format.
- *
- * @param instance   NS 16550 driver instance.
- * @param baud_rate  Transmission speed in bits per second, also known as baud,
- *                   maximum value is 115200.
- * @param lcr_format Line Control Register configuration bits, as defined by
- *                   the @c LCR_ macros.  These configure the word width,
- *                   parity type, and stop bit count.
- */
-void ns16550_format_set(ns16550_instance_t *instance,
-    unsigned baud_rate, uint8_t lcr_format)
-{
-	uint16_t divisor;
-
-	divisor = (uint16_t)(NS156440_CLOCK / baud_rate);
-	if (divisor == 0)
-		divisor = 1;  /* Avoid division by zero. */
-
-	ns16550_reg_write(instance, NS16550_REG_LCR, LCR_DLAB);
-	ns16550_reg_write(instance, NS16550_REG_DLL, divisor & 0xFF);
-	ns16550_reg_write(instance, NS16550_REG_DLH, (divisor >> 8) & 0xFF);
-	ns16550_reg_write(instance, NS16550_REG_LCR, lcr_format & ~LCR_DLAB);
-}
-
 /** Initialize ns16550.
  *
Index: kernel/generic/include/adt/list.h
===================================================================
--- kernel/generic/include/adt/list.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/adt/list.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -95,5 +95,5 @@
 
 #define list_foreach(list, member, itype, iterator) \
-	for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) sizeof(itype)) \
+	for (itype *iterator = NULL; iterator == NULL; iterator = &((itype *) NULL)[1]) \
 		for (link_t *_link = (list).head.next; \
 		    iterator = list_get_instance(_link, itype, member), \
@@ -101,5 +101,5 @@
 
 #define list_foreach_rev(list, member, itype, iterator) \
-	for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) sizeof(itype)) \
+	for (itype *iterator = NULL; iterator == NULL; iterator = &((itype *) NULL)[1]) \
 		for (link_t *_link = (list).head.prev; \
 		    iterator = list_get_instance(_link, itype, member), \
Index: kernel/generic/include/atomic.h
===================================================================
--- kernel/generic/include/atomic.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/atomic.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -40,4 +40,13 @@
 #include <stdatomic.h>
 
+// TODO: Remove.
+// Before <stdatomic.h> was available, there was only one atomic type
+// equivalent to atomic_size_t. This means that in some places, atomic_t can
+// be replaced with a more appropriate type (e.g. atomic_bool for flags or
+// a signed type for potentially signed values).
+// So atomic_t should be replaced with the most appropriate type on a case by
+// case basis, and after there are no more uses, remove this type.
+typedef atomic_size_t atomic_t;
+
 #define atomic_predec(val) \
 	(atomic_fetch_sub((val), 1) - 1)
Index: kernel/generic/include/cap/cap.h
===================================================================
--- kernel/generic/include/cap/cap.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/cap/cap.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -80,5 +80,5 @@
 typedef struct kobject {
 	kobject_type_t type;
-	atomic_size_t refcnt;
+	atomic_t refcnt;
 
 	/** Mutex protecting caps_list */
Index: kernel/generic/include/cpu.h
===================================================================
--- kernel/generic/include/cpu.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/cpu.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -58,5 +58,5 @@
 	context_t saved_context;
 
-	atomic_size_t nrdy;
+	atomic_t nrdy;
 	runq_t rq[RQ_COUNT];
 	volatile size_t needs_relink;
Index: kernel/generic/include/halt.h
===================================================================
--- kernel/generic/include/halt.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/halt.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -38,5 +38,5 @@
 #include <atomic.h>
 
-extern atomic_bool haltstate;
+extern atomic_t haltstate;
 
 extern void halt(void) __attribute__((noreturn));
Index: kernel/generic/include/ipc/ipc.h
===================================================================
--- kernel/generic/include/ipc/ipc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/ipc/ipc.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -71,5 +71,5 @@
 	struct call *hangup_call;
 	ipc_phone_state_t state;
-	atomic_size_t active_calls;
+	atomic_t active_calls;
 	/** User-defined label */
 	sysarg_t label;
@@ -90,5 +90,5 @@
 	 * Number of answers the answerbox is expecting to eventually arrive.
 	 */
-	atomic_size_t active_calls;
+	atomic_t active_calls;
 
 	/** Phones connected to this answerbox. */
Index: kernel/generic/include/mm/slab.h
===================================================================
--- kernel/generic/include/mm/slab.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/mm/slab.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -99,9 +99,9 @@
 
 	/* Statistics */
-	atomic_size_t allocated_slabs;
-	atomic_size_t allocated_objs;
-	atomic_size_t cached_objs;
+	atomic_t allocated_slabs;
+	atomic_t allocated_objs;
+	atomic_t cached_objs;
 	/** How many magazines in magazines list */
-	atomic_size_t magazine_counter;
+	atomic_t magazine_counter;
 
 	/* Slabs */
Index: kernel/generic/include/proc/scheduler.h
===================================================================
--- kernel/generic/include/proc/scheduler.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/proc/scheduler.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -52,5 +52,5 @@
 } runq_t;
 
-extern atomic_size_t nrdy;
+extern atomic_t nrdy;
 extern void scheduler_init(void);
 
Index: kernel/generic/include/proc/task.h
===================================================================
--- kernel/generic/include/proc/task.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/include/proc/task.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -87,7 +87,7 @@
 
 	/** Number of references (i.e. threads). */
-	atomic_size_t refcount;
+	atomic_t refcount;
 	/** Number of threads that haven't exited yet. */
-	atomic_size_t lifecount;
+	atomic_t lifecount;
 
 	/** Task permissions. */
Index: kernel/generic/src/console/console.c
===================================================================
--- kernel/generic/src/console/console.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/src/console/console.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -379,5 +379,5 @@
 		 * The early_putuchar() function is used to output
 		 * the character for low-level debugging purposes.
-		 * Note that the early_putuchar() function might be
+		 * Note that the early_putc() function might be
 		 * a no-op on certain hardware configurations.
 		 */
Index: kernel/generic/src/lib/halt.c
===================================================================
--- kernel/generic/src/lib/halt.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/src/lib/halt.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -36,5 +36,4 @@
  */
 
-#include <stdbool.h>
 #include <halt.h>
 #include <log.h>
@@ -45,5 +44,5 @@
 
 /** Halt flag */
-atomic_bool haltstate = false;
+atomic_t haltstate = 0;
 
 /** Halt wrapper
@@ -58,9 +57,9 @@
 
 	if (!atomic_load(&haltstate)) {
-		atomic_store(&haltstate, true);
+		atomic_store(&haltstate, 1);
 		rundebugger = true;
 	}
 #else
-	atomic_store(&haltstate, true);
+	atomic_store(&haltstate, 1);
 #endif
 
Index: kernel/generic/src/mm/frame.c
===================================================================
--- kernel/generic/src/mm/frame.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/src/mm/frame.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -370,5 +370,4 @@
 {
 	assert(zone->flags & ZONE_AVAILABLE);
-	assert(zone->free_count >= count);
 
 	/* Allocate frames from zone */
@@ -411,9 +410,8 @@
 
 	frame_t *frame = zone_get_frame(zone, index);
+
 	assert(frame->refcount > 0);
 
 	if (!--frame->refcount) {
-		assert(zone->busy_count > 0);
-
 		bitmap_set(&zone->bitmap, index, 0);
 
@@ -434,11 +432,7 @@
 
 	frame_t *frame = zone_get_frame(zone, index);
-	assert(frame->refcount <= 1);
-
 	if (frame->refcount > 0)
 		return;
 
-	assert(zone->free_count > 0);
-
 	frame->refcount = 1;
 	bitmap_set_range(&zone->bitmap, index, 1);
@@ -446,18 +440,4 @@
 	zone->free_count--;
 	reserve_force_alloc(1);
-}
-
-/** Mark frame in zone available to allocation. */
-_NO_TRACE static void zone_mark_available(zone_t *zone, size_t index)
-{
-	assert(zone->flags & ZONE_AVAILABLE);
-
-	frame_t *frame = zone_get_frame(zone, index);
-	assert(frame->refcount == 1);
-
-	frame->refcount = 0;
-	bitmap_set_range(&zone->bitmap, index, 0);
-
-	zone->free_count++;
 }
 
@@ -485,5 +465,4 @@
 	/* Difference between zone bases */
 	pfn_t base_diff = zones.info[z2].base - zones.info[z1].base;
-	pfn_t gap = base_diff - zones.info[z1].count;
 
 	zones.info[z1].count = base_diff + zones.info[z2].count;
@@ -513,13 +492,4 @@
 		    zones.info[z2].frames[i];
 	}
-
-	/*
-	 * Mark the gap between the original zones as unavailable.
-	 */
-
-	for (size_t i = 0; i < gap; i++) {
-		frame_initialize(&zones.info[z1].frames[old_z1->count + i]);
-		zone_mark_unavailable(&zones.info[z1], old_z1->count + i);
-	}
 }
 
@@ -548,5 +518,5 @@
 
 	for (size_t i = 0; i < cframes; i++)
-		zone_mark_available(&zones.info[znum],
+		(void) zone_frame_free(&zones.info[znum],
 		    pfn - zones.info[znum].base + i);
 }
Index: kernel/generic/src/proc/scheduler.c
===================================================================
--- kernel/generic/src/proc/scheduler.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/generic/src/proc/scheduler.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -68,5 +68,5 @@
 static void scheduler_separated_stack(void);
 
-atomic_size_t nrdy;  /**< Number of ready threads in the system. */
+atomic_t nrdy;  /**< Number of ready threads in the system. */
 
 /** Carry out actions before new task runs. */
Index: kernel/test/atomic/atomic1.c
===================================================================
--- kernel/test/atomic/atomic1.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/test/atomic/atomic1.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -32,5 +32,5 @@
 const char *test_atomic1(void)
 {
-	atomic_int a;
+	atomic_t a;
 
 	atomic_store(&a, 10);
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/test/mm/falloc2.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -43,6 +43,6 @@
 #define THREADS      8
 
-static atomic_size_t thread_cnt;
-static atomic_size_t thread_fail;
+static atomic_t thread_cnt;
+static atomic_t thread_fail;
 
 static void falloc(void *arg)
Index: kernel/test/synch/semaphore1.c
===================================================================
--- kernel/test/synch/semaphore1.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/test/synch/semaphore1.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -41,6 +41,6 @@
 
 static waitq_t can_start;
-static atomic_size_t items_produced;
-static atomic_size_t items_consumed;
+static atomic_t items_produced;
+static atomic_t items_consumed;
 
 static void producer(void *arg)
Index: kernel/test/thread/thread1.c
===================================================================
--- kernel/test/thread/thread1.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ kernel/test/thread/thread1.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -30,5 +30,4 @@
 #include <test.h>
 #include <atomic.h>
-#include <stdbool.h>
 #include <proc/thread.h>
 
@@ -37,6 +36,6 @@
 #define THREADS  5
 
-static atomic_bool finish;
-static atomic_size_t threads_finished;
+static atomic_t finish;
+static atomic_t threads_finished;
 
 static void threadtest(void *data)
@@ -56,5 +55,5 @@
 	size_t total = 0;
 
-	atomic_store(&finish, true);
+	atomic_store(&finish, 1);
 	atomic_store(&threads_finished, 0);
 
@@ -73,5 +72,5 @@
 	thread_sleep(10);
 
-	atomic_store(&finish, false);
+	atomic_store(&finish, 0);
 	while (atomic_load(&threads_finished) < total) {
 		TPRINTF("Threads left: %zu\n", total - atomic_load(&threads_finished));
Index: meson/arch/arm64/meson.build
===================================================================
--- meson/arch/arm64/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ meson/arch/arm64/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -32,4 +32,5 @@
 arch_uspace_link_args = [ '-nostdlib', '-lgcc' ]
 
+
 # UEFI binaries should be relocatable, the EFI boot service LoadImage() will
 # rebase the boot file using the .reloc information in the image if it cannot
@@ -45,4 +46,5 @@
 arch_boot_link_args = [ '-Wl,-shared', '-Wl,--no-gc-sections' ]
 
+
 if MACHINE == 'virt'
 	rd_essential += [
@@ -52,10 +54,2 @@
 	]
 endif
-
-if MACHINE == 'hikey960'
-	rd_essential += [
-		'drv/char/pl011',
-		'drv/intctl/gicv2',
-		'drv/platform/hikey960',
-	]
-endif
Index: ols/deploy/hikey960/fastboot
===================================================================
--- tools/deploy/hikey960/fastboot	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,88 +1,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2021 Martin Decky
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-# This script allows to deploy HelenOS conveniently to the HiKey 960 board
-# using the fastboot protocol. The fastboot mechanism is provided as a part
-# of the default UEFI firmware on HiKey 960.
-#
-# The implementation of the fastboot mechanism on HiKey 960 has several
-# quirks and this script tries to accommodate for them:
-#
-# * The boot image must be compressed by GZip. Uncompressed boot images are
-#   rejected.
-#
-# * The compressed boot image must end with a device tree blob (even if
-#   the device tree is not actually processed). A missing device tree blob
-#   crashes the fastboot mechanism.
-#
-# * A RAM disk must be included in the final fastboot image. A missing RAM
-#   disk crashes the fastboot mechanism. We use a fake blob for that purpose.
-
-check_error() {
-	if [ "$1" -ne "0" ] ; then
-		echo
-		echo "Error: $2"
-
-		exit 1
-	fi
-}
-
-SCRIPT_DIR="$(readlink -f $(dirname "$0"))"
-
-if [ "$#" -lt "1" ] ; then
-	echo "Usage: $0 <image.boot>"
-	exit 2
-fi
-
-IMAGE="$1"
-IMAGE_GZ="${IMAGE}.gz"
-IMAGE_GZ_DTB="${IMAGE_GZ}+dtb"
-IMAGE_FASTBOOT="${IMAGE}.fastboot"
-
-if [ ! -f "${IMAGE}" ] ; then
-	echo "Error: ${IMAGE} is not a file"
-	exit 3
-fi
-
-# Compress the image
-gzip -c "${IMAGE}" > "${IMAGE_GZ}"
-check_error $? "Compressing ${IMAGE}"
-
-# Append the DTB
-cat "${IMAGE_GZ}" "${SCRIPT_DIR}/hi3660-hikey960.dtb" > "${IMAGE_GZ_DTB}"
-check_error $? "Appending DTB to ${IMAGE_GZ}"
-
-# Create the fastboot image with a fake "RAM disk"
-"${SCRIPT_DIR}/mkfastboot" --kernel ${IMAGE_GZ_DTB} --ramdisk "${SCRIPT_DIR}/hikey960.rd" --base 0x0 --tags-addr 0x07a00000 --kernel_offset 0x00080000 --ramdisk_offset 0x07c00000 --output "${IMAGE_FASTBOOT}"
-check_error $? "Converting ${IMAGE_GZ_DTB} to a fastboot image"
-
-# Deploy the fastboot image on a HiKey 960 board connected to the host machine
-fastboot boot "${IMAGE_FASTBOOT}"
-check_error $? "Deploying ${IMAGE_FASTBOOT}"
Index: ols/deploy/hikey960/hikey960.rd
===================================================================
--- tools/deploy/hikey960/hikey960.rd	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,1 +1,0 @@
-ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Index: ols/deploy/hikey960/mkfastboot
===================================================================
--- tools/deploy/hikey960/mkfastboot	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,185 +1,0 @@
-#!/usr/bin/env python
-
-# Copyright 2015, The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from __future__ import print_function
-from sys import argv, exit, stderr
-from argparse import ArgumentParser, FileType, Action
-from os import fstat
-from struct import pack
-from hashlib import sha1
-import sys
-import re
-
-def filesize(f):
-    if f is None:
-        return 0
-    try:
-        return fstat(f.fileno()).st_size
-    except OSError:
-        return 0
-
-def update_sha(sha, f):
-    if f:
-        sha.update(f.read())
-        f.seek(0)
-        sha.update(pack('I', filesize(f)))
-    else:
-        sha.update(pack('I', 0))
-
-def pad_file(f, padding):
-    pad = (padding - (f.tell() & (padding - 1))) & (padding - 1)
-    f.write(pack(str(pad) + 'x'))
-
-def write_header(args):
-    BOOT_MAGIC = 'ANDROID!'.encode()
-    dt_addr = args.tags_addr
-
-    if 0 == dt_addr:
-        dt_addr = args.base + args.tags_offset
-
-    args.output.write(pack('8s', BOOT_MAGIC))
-    args.output.write(pack('10I',
-        filesize(args.kernel),                          # size in bytes
-        args.base + args.kernel_offset,                 # physical load addr
-        filesize(args.ramdisk),                         # size in bytes
-        args.base + args.ramdisk_offset,                # physical load addr
-        filesize(args.second),                          # size in bytes
-        args.base + args.second_offset,                 # physical load addr
-        dt_addr,                                        # physical addr for kernel tags
-        args.pagesize,                                  # flash page size we assume
-        0,                                              # future expansion: MUST be 0
-        (args.os_version << 11) | args.os_patch_level)) # os version and patch level
-    args.output.write(pack('16s', args.board.encode())) # asciiz product name
-    args.output.write(pack('512s', args.cmdline[:512].encode()))
-
-    sha = sha1()
-    update_sha(sha, args.kernel)
-    update_sha(sha, args.ramdisk)
-    update_sha(sha, args.second)
-    img_id = pack('32s', sha.digest())
-
-    args.output.write(img_id)
-    args.output.write(pack('1024s', args.cmdline[512:].encode()))
-    pad_file(args.output, args.pagesize)
-
-    return img_id
-
-class ValidateStrLenAction(Action):
-    def __init__(self, option_strings, dest, nargs=None, **kwargs):
-        if 'maxlen' not in kwargs:
-            raise ValueError('maxlen must be set')
-
-        self.maxlen = int(kwargs['maxlen'])
-        del kwargs['maxlen']
-        super(ValidateStrLenAction, self).__init__(option_strings, dest, **kwargs)
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        if len(values) > self.maxlen:
-            raise ValueError('String argument too long: max {0:d}, got {1:d}'.
-                format(self.maxlen, len(values)))
-        setattr(namespace, self.dest, values)
-
-def write_padded_file(f_out, f_in, padding):
-    if f_in is None:
-        return
-
-    f_out.write(f_in.read())
-    pad_file(f_out, padding)
-
-def parse_int(x):
-    return int(x, 0)
-
-def parse_os_version(x):
-    match = re.search(r'^(\d{1,3})(?:\.(\d{1,3})(?:\.(\d{1,3}))?)?', x)
-    if match:
-        a = int(match.group(1))
-        b = 0
-        c = 0
-
-        if match.lastindex >= 2:
-            b = int(match.group(2))
-
-        if match.lastindex == 3:
-            c = int(match.group(3))
-
-        # 7 bits allocated for each field
-        assert a < 128
-        assert b < 128
-        assert c < 128
-        return (a << 14) | (b << 7) | c
-
-    return 0
-
-def parse_os_patch_level(x):
-    match = re.search(r'^(\d{4})-(\d{2})-(\d{2})', x)
-    if match:
-        y = int(match.group(1)) - 2000
-        m = int(match.group(2))
-
-        # 7 bits allocated for the year, 4 bits for the month
-        assert y >= 0 and y < 128
-        assert m > 0 and m <= 12
-        return (y << 4) | m
-
-    return 0
-
-def parse_cmdline():
-    parser = ArgumentParser()
-    parser.add_argument('--kernel', help='path to the kernel', type=FileType('rb'),
-                        required=True)
-    parser.add_argument('--ramdisk', help='path to the ramdisk', type=FileType('rb'))
-    parser.add_argument('--second', help='path to the 2nd bootloader', type=FileType('rb'))
-    parser.add_argument('--cmdline', help='extra arguments to be passed on the '
-                        'kernel command line', default='', action=ValidateStrLenAction, maxlen=1536)
-    parser.add_argument('--base', help='base address', type=parse_int, default=0x10000000)
-    parser.add_argument('--tags-addr', help='tags addr', type=parse_int, default=0x0)
-    parser.add_argument('--kernel_offset', help='kernel offset', type=parse_int, default=0x00008000)
-    parser.add_argument('--ramdisk_offset', help='ramdisk offset', type=parse_int, default=0x01000000)
-    parser.add_argument('--second_offset', help='2nd bootloader offset', type=parse_int,
-                        default=0x00f00000)
-    parser.add_argument('--os_version', help='operating system version', type=parse_os_version,
-                        default=0)
-    parser.add_argument('--os_patch_level', help='operating system patch level',
-                        type=parse_os_patch_level, default=0)
-    parser.add_argument('--tags_offset', help='tags offset', type=parse_int, default=0x00000100)
-    parser.add_argument('--board', help='board name', default='', action=ValidateStrLenAction,
-                        maxlen=16)
-    parser.add_argument('--pagesize', help='page size', type=parse_int,
-                        choices=[2**i for i in range(11,15)], default=2048)
-    parser.add_argument('--id', help='print the image ID on standard output',
-                        action='store_true')
-    parser.add_argument('-o', '--output', help='output file name', type=FileType('wb'),
-                        required=True)
-    return parser.parse_args()
-
-def write_data(args):
-    write_padded_file(args.output, args.kernel, args.pagesize)
-    write_padded_file(args.output, args.ramdisk, args.pagesize)
-    write_padded_file(args.output, args.second, args.pagesize)
-
-def main():
-    args = parse_cmdline()
-    img_id = write_header(args)
-    write_data(args)
-    if args.id:
-        if isinstance(img_id, str):
-            # Python 2's struct.pack returns a string, but py3 returns bytes.
-            img_id = [ord(x) for x in img_id]
-
-        print('0x' + ''.join('{:02x}'.format(c) for c in img_id))
-
-if __name__ == '__main__':
-    main()
Index: tools/ew.py
===================================================================
--- tools/ew.py	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ tools/ew.py	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -144,20 +144,19 @@
 			return 'system-arm', '-M raspi1ap'
 	elif platform == 'arm64':
-		if machine == 'virt':
-			# Search for the EDK2 firmware image
-			default_paths = (
-				'/usr/local/qemu-efi-aarch64/QEMU_EFI.fd', # Custom
-				'/usr/share/edk2/aarch64/QEMU_EFI.fd',     # Fedora
-				'/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', # Ubuntu
-			)
-			extra_info = ("Pre-compiled binary can be obtained from "
-			    "http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd.\n")
-			efi_path = find_firmware(
-			    "EDK2", 'EW_QEMU_EFI_AARCH64', default_paths, extra_info)
-			if efi_path is None:
-				raise Exception
-
-			return 'system-aarch64', \
-			    '-M virt -cpu cortex-a57 -m 1024 -bios %s' % efi_path
+		# Search for the EDK2 firmware image
+		default_paths = (
+			'/usr/local/qemu-efi-aarch64/QEMU_EFI.fd', # Custom
+			'/usr/share/edk2/aarch64/QEMU_EFI.fd',     # Fedora
+			'/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', # Ubuntu
+		)
+		extra_info = ("Pre-compiled binary can be obtained from "
+		    "http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd.\n")
+		efi_path = find_firmware(
+		    "EDK2", 'EW_QEMU_EFI_AARCH64', default_paths, extra_info)
+		if efi_path is None:
+			raise Exception
+
+		return 'system-aarch64', \
+		    '-M virt -cpu cortex-a57 -m 1024 -bios %s' % efi_path
 	elif platform == 'ia32':
 		return 'system-i386', pc_options(32)
Index: uspace/app/calculator/calculator.c
===================================================================
--- uspace/app/calculator/calculator.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/calculator/calculator.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -833,16 +833,16 @@
 	if (ui_is_textmode(ui)) {
 		params.rect.p1.x = 38;
-		params.rect.p1.y = 18;
+		params.rect.p1.y = 19;
 
 		calc.geom.menubar_rect.p0.x = 1;
-		calc.geom.menubar_rect.p0.y = 1;
+		calc.geom.menubar_rect.p0.y = 2;
 		calc.geom.menubar_rect.p1.x = params.rect.p1.x - 1;
-		calc.geom.menubar_rect.p1.y = 2;
+		calc.geom.menubar_rect.p1.y = 3;
 		calc.geom.entry_rect.p0.x = 4;
-		calc.geom.entry_rect.p0.y = 3;
+		calc.geom.entry_rect.p0.y = 4;
 		calc.geom.entry_rect.p1.x = 34;
-		calc.geom.entry_rect.p1.y = 4;
+		calc.geom.entry_rect.p1.y = 5;
 		calc.geom.btn_orig.x = 4;
-		calc.geom.btn_orig.y = 5;
+		calc.geom.btn_orig.y = 6;
 		calc.geom.btn_dim.x = 6;
 		calc.geom.btn_dim.y = 2;
@@ -945,5 +945,4 @@
 	ui_entry_set_rect(display, &calc.geom.entry_rect);
 	ui_entry_set_halign(display, gfx_halign_right);
-	ui_entry_set_read_only(display, true);
 
 	rc = ui_fixed_add(fixed, ui_entry_ctl(display));
Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/edit/edit.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2009 Jiri Svoboda
  * Copyright (c) 2012 Martin Sucha
  * All rights reserved.
@@ -36,34 +36,17 @@
  */
 
-#include <align.h>
-#include <clipboard.h>
-#include <errno.h>
-#include <gfx/color.h>
-#include <gfx/cursor.h>
-#include <gfx/font.h>
-#include <gfx/render.h>
-#include <gfx/text.h>
-#include <io/kbd_event.h>
-#include <io/keycode.h>
-#include <io/pos_event.h>
-#include <io/style.h>
-#include <macros.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <stdbool.h>
+#include <vfs/vfs.h>
+#include <io/console.h>
+#include <io/style.h>
+#include <io/keycode.h>
+#include <errno.h>
+#include <align.h>
+#include <macros.h>
+#include <clipboard.h>
 #include <types/common.h>
-#include <ui/control.h>
-#include <ui/filedialog.h>
-#include <ui/fixed.h>
-#include <ui/label.h>
-#include <ui/menu.h>
-#include <ui/menubar.h>
-#include <ui/menuentry.h>
-#include <ui/promptdialog.h>
-#include <ui/resource.h>
-#include <ui/ui.h>
-#include <ui/window.h>
-#include <vfs/vfs.h>
 
 #include "sheet.h"
@@ -80,26 +63,7 @@
  *
  * A rectangular area of the screen used to edit a document. Different
- * panes can be possibly used to edit the same document. This is a custom
- * UI control.
+ * panes can be possibly used to edit the same document.
  */
 typedef struct {
-	/** Base control object */
-	struct ui_control *control;
-
-	/** Containing window */
-	ui_window_t *window;
-
-	/** UI resource */
-	struct ui_resource *res;
-
-	/** Pane rectangle */
-	gfx_rect_t rect;
-
-	/** Pane color */
-	gfx_color_t *color;
-
-	/** Selection color */
-	gfx_color_t *sel_color;
-
 	/* Pane dimensions */
 	int rows, columns;
@@ -126,22 +90,7 @@
 	int ideal_column;
 
-	bool search_reverse;
 	char *previous_search;
 	bool previous_search_reverse;
 } pane_t;
-
-/** Text editor */
-typedef struct {
-	/** User interface */
-	ui_t *ui;
-	/** Editor window */
-	ui_window_t *window;
-	/** UI resource */
-	ui_resource_t *ui_res;
-	/** Menu bar */
-	ui_menu_bar_t *menubar;
-	/** Status bar */
-	ui_label_t *status;
-} edit_t;
 
 /** Document
@@ -154,7 +103,12 @@
 } doc_t;
 
-static edit_t edit;
+static console_ctrl_t *con;
 static doc_t doc;
+static bool done;
 static pane_t pane;
+static bool cursor_visible;
+
+static sysarg_t scr_rows;
+static sysarg_t scr_columns;
 
 #define ROW_BUF_SIZE 4096
@@ -165,4 +119,6 @@
 #define INFNAME_MAX_LEN 128
 
+static void cursor_show(void);
+static void cursor_hide(void);
 static void cursor_setvis(bool visible);
 
@@ -183,13 +139,11 @@
 static char *range_get_str(spt_t const *spos, spt_t const *epos);
 
-static errno_t pane_init(ui_window_t *, pane_t *);
-static void pane_fini(pane_t *);
-static ui_control_t *pane_ctl(pane_t *);
-static errno_t pane_update(pane_t *);
-static errno_t pane_text_display(pane_t *);
+static char *prompt(char const *prompt, char const *init_value);
+
+static void pane_text_display(void);
 static void pane_row_display(void);
-static errno_t pane_row_range_display(pane_t *, int r0, int r1);
-static void pane_status_display(pane_t *);
-static void pane_caret_display(pane_t *);
+static void pane_row_range_display(int r0, int r1);
+static void pane_status_display(void);
+static void pane_caret_display(void);
 
 static void insert_char(char32_t c);
@@ -210,6 +164,4 @@
 static void selection_delete(void);
 static void selection_copy(void);
-static void edit_cut(void);
-static void edit_paste(void);
 static void insert_clipboard_data(void);
 
@@ -233,74 +185,18 @@
 
 static void status_display(char const *str);
-static errno_t edit_ui_create(edit_t *);
-static void edit_ui_destroy(edit_t *);
-
-static void edit_wnd_close(ui_window_t *, void *);
-static void edit_wnd_kbd_event(ui_window_t *, void *, kbd_event_t *);
-
-static ui_window_cb_t edit_window_cb = {
-	.close = edit_wnd_close,
-	.kbd = edit_wnd_kbd_event
-};
-
-static void edit_file_save(ui_menu_entry_t *, void *);
-static void edit_file_save_as(ui_menu_entry_t *, void *);
-static void edit_file_exit(ui_menu_entry_t *, void *);
-static void edit_edit_cut(ui_menu_entry_t *, void *);
-static void edit_edit_copy(ui_menu_entry_t *, void *);
-static void edit_edit_paste(ui_menu_entry_t *, void *);
-static void edit_edit_delete(ui_menu_entry_t *, void *);
-static void edit_edit_select_all(ui_menu_entry_t *, void *);
-static void edit_search_find(ui_menu_entry_t *, void *);
-static void edit_search_reverse_find(ui_menu_entry_t *, void *);
-static void edit_search_find_next(ui_menu_entry_t *, void *);
-static void edit_search_go_to_line(ui_menu_entry_t *, void *);
-
-static void pane_ctl_destroy(void *);
-static errno_t pane_ctl_paint(void *);
-static ui_evclaim_t pane_ctl_pos_event(void *, pos_event_t *);
-
-/** Pabe control ops */
-ui_control_ops_t pane_ctl_ops = {
-	.destroy = pane_ctl_destroy,
-	.paint = pane_ctl_paint,
-	.pos_event = pane_ctl_pos_event
-};
-
-static void save_as_dialog_bok(ui_file_dialog_t *, void *, const char *);
-static void save_as_dialog_bcancel(ui_file_dialog_t *, void *);
-static void save_as_dialog_close(ui_file_dialog_t *, void *);
-
-static ui_file_dialog_cb_t save_as_dialog_cb = {
-	.bok = save_as_dialog_bok,
-	.bcancel = save_as_dialog_bcancel,
-	.close = save_as_dialog_close
-};
-
-static void go_to_line_dialog_bok(ui_prompt_dialog_t *, void *, const char *);
-static void go_to_line_dialog_bcancel(ui_prompt_dialog_t *, void *);
-static void go_to_line_dialog_close(ui_prompt_dialog_t *, void *);
-
-static ui_prompt_dialog_cb_t go_to_line_dialog_cb = {
-	.bok = go_to_line_dialog_bok,
-	.bcancel = go_to_line_dialog_bcancel,
-	.close =  go_to_line_dialog_close
-};
-
-static void search_dialog_bok(ui_prompt_dialog_t *, void *, const char *);
-static void search_dialog_bcancel(ui_prompt_dialog_t *, void *);
-static void search_dialog_close(ui_prompt_dialog_t *, void *);
-
-static ui_prompt_dialog_cb_t search_dialog_cb = {
-	.bok = search_dialog_bok,
-	.bcancel = search_dialog_bcancel,
-	.close =  search_dialog_close
-};
 
 int main(int argc, char *argv[])
 {
+	cons_event_t ev;
 	bool new_file;
 	errno_t rc;
 
+	con = console_init(stdin, stdout);
+	console_clear(con);
+
+	console_get_size(con, &scr_columns, &scr_rows);
+
+	pane.rows = scr_rows - 1;
+	pane.columns = scr_columns;
 	pane.sh_row = 1;
 	pane.sh_column = 1;
@@ -338,288 +234,57 @@
 	/* Move to beginning of file. */
 	pt_get_sof(&sof);
-
-	/* Create UI */
-	rc = edit_ui_create(&edit);
-	if (rc != EOK)
-		return 1;
-
 	caret_move(sof, true, true);
 
 	/* Initial display */
-	rc = ui_window_paint(edit.window);
-	if (rc != EOK) {
-		printf("Error painting window.\n");
-		return rc;
-	}
-
-	pane_status_display(&pane);
+	cursor_visible = true;
+
+	cursor_hide();
+	console_clear(con);
+	pane_text_display();
+	pane_status_display();
 	if (new_file && doc.file_name != NULL)
 		status_display("File not found. Starting empty file.");
-	pane_caret_display(&pane);
-	cursor_setvis(true);
-
-	ui_run(edit.ui);
-
-	edit_ui_destroy(&edit);
+	pane_caret_display();
+	cursor_show();
+
+	done = false;
+
+	while (!done) {
+		rc = console_get_event(con, &ev);
+		if (rc != EOK)
+			break;
+
+		pane.rflags = 0;
+
+		switch (ev.type) {
+		case CEV_KEY:
+			pane.keymod = ev.ev.key.mods;
+			if (ev.ev.key.type == KEY_PRESS)
+				key_handle_press(&ev.ev.key);
+			break;
+		case CEV_POS:
+			pos_handle(&ev.ev.pos);
+			break;
+		}
+
+		/* Redraw as necessary. */
+
+		cursor_hide();
+
+		if (pane.rflags & REDRAW_TEXT)
+			pane_text_display();
+		if (pane.rflags & REDRAW_ROW)
+			pane_row_display();
+		if (pane.rflags & REDRAW_STATUS)
+			pane_status_display();
+		if (pane.rflags & REDRAW_CARET)
+			pane_caret_display();
+
+		cursor_show();
+	}
+
+	console_clear(con);
+
 	return 0;
-}
-
-/** Create text editor UI.
- *
- * @param edit Editor
- * @return EOK on success or an error code
- */
-static errno_t edit_ui_create(edit_t *edit)
-{
-	errno_t rc;
-	ui_wnd_params_t params;
-	ui_fixed_t *fixed = NULL;
-	ui_menu_t *mfile = NULL;
-	ui_menu_t *medit = NULL;
-	ui_menu_entry_t *msave = NULL;
-	ui_menu_entry_t *msaveas = NULL;
-	ui_menu_entry_t *mfsep = NULL;
-	ui_menu_entry_t *mexit = NULL;
-	ui_menu_entry_t *mcut = NULL;
-	ui_menu_entry_t *mcopy = NULL;
-	ui_menu_entry_t *mpaste = NULL;
-	ui_menu_entry_t *mdelete = NULL;
-	ui_menu_entry_t *mesep = NULL;
-	ui_menu_entry_t *mselall = NULL;
-	ui_menu_t *msearch = NULL;
-	ui_menu_entry_t *mfind = NULL;
-	ui_menu_entry_t *mfindr = NULL;
-	ui_menu_entry_t *mfindn = NULL;
-	ui_menu_entry_t *mssep = NULL;
-	ui_menu_entry_t *mgoto = NULL;
-	gfx_rect_t arect;
-	gfx_rect_t rect;
-
-	rc = ui_create(UI_CONSOLE_DEFAULT, &edit->ui);
-	if (rc != EOK) {
-		printf("Error creating UI on display %s.\n",
-		    UI_CONSOLE_DEFAULT);
-		goto error;
-	}
-
-	ui_wnd_params_init(&params);
-	params.caption = "Text Editor";
-	params.style &= ~ui_wds_decorated;
-	params.placement = ui_wnd_place_full_screen;
-
-	rc = ui_window_create(edit->ui, &params, &edit->window);
-	if (rc != EOK) {
-		printf("Error creating window.\n");
-		goto error;
-	}
-
-	ui_window_set_cb(edit->window, &edit_window_cb, (void *) edit);
-
-	edit->ui_res = ui_window_get_res(edit->window);
-
-	rc = ui_fixed_create(&fixed);
-	if (rc != EOK) {
-		printf("Error creating fixed layout.\n");
-		return rc;
-	}
-
-	rc = ui_menu_bar_create(edit->ui, edit->window, &edit->menubar);
-	if (rc != EOK) {
-		printf("Error creating menu bar.\n");
-		return rc;
-	}
-
-	rc = ui_menu_create(edit->menubar, "File", &mfile);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	rc = ui_menu_entry_create(mfile, "Save", "Ctrl-S", &msave);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(msave, edit_file_save, (void *) edit);
-
-	rc = ui_menu_entry_create(mfile, "Save As", "Ctrl-E", &msaveas);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(msaveas, edit_file_save_as, (void *) edit);
-
-	rc = ui_menu_entry_sep_create(mfile, &mfsep);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	rc = ui_menu_entry_create(mfile, "Exit", "Ctrl-Q", &mexit);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mexit, edit_file_exit, (void *) edit);
-
-	rc = ui_menu_create(edit->menubar, "Edit", &medit);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	rc = ui_menu_entry_create(medit, "Cut", "Ctrl-X", &mcut);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mcut, edit_edit_cut, (void *) edit);
-
-	rc = ui_menu_entry_create(medit, "Copy", "Ctrl-C", &mcopy);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mcopy, edit_edit_copy, (void *) edit);
-
-	rc = ui_menu_entry_create(medit, "Paste", "Ctrl-V", &mpaste);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mpaste, edit_edit_paste, (void *) edit);
-
-	rc = ui_menu_entry_create(medit, "Delete", "Del", &mdelete);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mdelete, edit_edit_delete, (void *) edit);
-
-	rc = ui_menu_entry_sep_create(medit, &mesep);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	rc = ui_menu_entry_create(medit, "Select All", "Ctrl-A", &mselall);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mselall, edit_edit_select_all, (void *) edit);
-
-	rc = ui_menu_create(edit->menubar, "Search", &msearch);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	rc = ui_menu_entry_create(msearch, "Find", "Ctrl-F", &mfind);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mfind, edit_search_find, (void *) edit);
-
-	rc = ui_menu_entry_create(msearch, "Reverse Find", "Ctrl-Shift-F", &mfindr);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mfindr, edit_search_reverse_find, (void *) edit);
-
-	rc = ui_menu_entry_create(msearch, "Find Next", "Ctrl-N", &mfindn);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mfindn, edit_search_find_next, (void *) edit);
-
-	rc = ui_menu_entry_sep_create(msearch, &mssep);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	rc = ui_menu_entry_create(msearch, "Go To Line", "Ctrl-L", &mgoto);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mgoto, edit_search_go_to_line, (void *) edit);
-
-	ui_window_get_app_rect(edit->window, &arect);
-
-	rect.p0 = arect.p0;
-	rect.p1.x = arect.p1.x;
-	rect.p1.y = arect.p0.y + 1;
-	ui_menu_bar_set_rect(edit->menubar, &rect);
-
-	rc = ui_fixed_add(fixed, ui_menu_bar_ctl(edit->menubar));
-	if (rc != EOK) {
-		printf("Error adding control to layout.\n");
-		return rc;
-	}
-
-	rc = pane_init(edit->window, &pane);
-	if (rc != EOK) {
-		printf("Error initializing pane.\n");
-		return rc;
-	}
-
-	rc = ui_fixed_add(fixed, pane_ctl(&pane));
-	if (rc != EOK) {
-		printf("Error adding control to layout.\n");
-		return rc;
-	}
-
-	rc = ui_label_create(edit->ui_res, "", &edit->status);
-	if (rc != EOK) {
-		printf("Error creating menu bar.\n");
-		return rc;
-	}
-
-	rect.p0.x = arect.p0.x;
-	rect.p0.y = arect.p1.y - 1;
-	rect.p1 = arect.p1;
-	ui_label_set_rect(edit->status, &rect);
-
-	rc = ui_fixed_add(fixed, ui_label_ctl(edit->status));
-	if (rc != EOK) {
-		printf("Error adding control to layout.\n");
-		return rc;
-	}
-
-	ui_window_add(edit->window, ui_fixed_ctl(fixed));
-	return EOK;
-error:
-	if (edit->window != NULL)
-		ui_window_destroy(edit->window);
-	if (edit->ui != NULL)
-		ui_destroy(edit->ui);
-	return rc;
-}
-
-/** Destroy text editor UI.
- *
- * @param edit Editor
- */
-static void edit_ui_destroy(edit_t *edit)
-{
-	ui_window_destroy(edit->window);
-	ui_destroy(edit->ui);
 }
 
@@ -644,9 +309,20 @@
 }
 
+static void cursor_show(void)
+{
+	cursor_setvis(true);
+}
+
+static void cursor_hide(void)
+{
+	cursor_setvis(false);
+}
+
 static void cursor_setvis(bool visible)
 {
-	gfx_context_t *gc = ui_window_get_gc(edit.window);
-
-	(void) gfx_cursor_set_visible(gc, visible);
+	if (cursor_visible != visible) {
+		console_cursor_visibility(con, visible);
+		cursor_visible = visible;
+	}
 }
 
@@ -724,5 +400,5 @@
 	switch (ev->key) {
 	case KC_Q:
-		ui_quit(edit.ui);
+		done = true;
 		break;
 	case KC_S:
@@ -739,8 +415,14 @@
 		break;
 	case KC_V:
-		edit_paste();
+		selection_delete();
+		insert_clipboard_data();
+		pane.rflags |= REDRAW_TEXT;
+		caret_update();
 		break;
 	case KC_X:
-		edit_cut();
+		selection_copy();
+		selection_delete();
+		pane.rflags |= REDRAW_TEXT;
+		caret_update();
 		break;
 	case KC_A:
@@ -808,6 +490,6 @@
 
 	if (ev->type == POS_PRESS && ev->vpos < (unsigned)pane.rows) {
-		bc.row = pane.sh_row + ev->vpos - pane.rect.p0.y;
-		bc.column = pane.sh_column + ev->hpos - pane.rect.p0.x;
+		bc.row = pane.sh_row + ev->vpos;
+		bc.column = pane.sh_column + ev->hpos;
 		sheet_get_cell_pt(doc.sh, &bc, dir_before, &pt);
 
@@ -815,5 +497,4 @@
 
 		caret_move(pt, select, true);
-		pane_update(&pane);
 	}
 }
@@ -925,23 +606,90 @@
 }
 
-/** Open Save As dialog. */
+/** Change document name and save. */
 static void file_save_as(void)
 {
 	const char *old_fname = (doc.file_name != NULL) ? doc.file_name : "";
-	ui_file_dialog_params_t fdparams;
-	ui_file_dialog_t *dialog;
+	char *fname;
+
+	fname = prompt("Save As", old_fname);
+	if (fname == NULL) {
+		status_display("Save cancelled.");
+		return;
+	}
+
+	errno_t rc = file_save(fname);
+	if (rc != EOK)
+		return;
+
+	if (doc.file_name != NULL)
+		free(doc.file_name);
+	doc.file_name = fname;
+}
+
+/** Ask for a string. */
+static char *prompt(char const *prompt, char const *init_value)
+{
+	cons_event_t ev;
+	kbd_event_t *kev;
+	char *str;
+	char32_t buffer[INFNAME_MAX_LEN + 1];
+	int max_len;
+	int nc;
+	bool done;
 	errno_t rc;
 
-	ui_file_dialog_params_init(&fdparams);
-	fdparams.caption = "Save As";
-	fdparams.ifname = old_fname;
-
-	rc = ui_file_dialog_create(edit.ui, &fdparams, &dialog);
-	if (rc != EOK) {
-		printf("Error creating message dialog.\n");
-		return;
-	}
-
-	ui_file_dialog_set_cb(dialog, &save_as_dialog_cb, &edit);
+	asprintf(&str, "%s: %s", prompt, init_value);
+	status_display(str);
+	console_set_pos(con, 1 + str_length(str), scr_rows - 1);
+	free(str);
+
+	console_set_style(con, STYLE_INVERTED);
+
+	max_len = min(INFNAME_MAX_LEN, scr_columns - 4 - str_length(prompt));
+	str_to_wstr(buffer, max_len + 1, init_value);
+	nc = wstr_length(buffer);
+	done = false;
+
+	while (!done) {
+		rc = console_get_event(con, &ev);
+		if (rc != EOK)
+			return NULL;
+
+		if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) {
+			kev = &ev.ev.key;
+
+			/* Handle key press. */
+			if ((kev->mods & (KM_CTRL | KM_ALT)) == 0) {
+				switch (kev->key) {
+				case KC_ESCAPE:
+					return NULL;
+				case KC_BACKSPACE:
+					if (nc > 0) {
+						putchar('\b');
+						console_flush(con);
+						--nc;
+					}
+					break;
+				case KC_ENTER:
+					done = true;
+					break;
+				default:
+					if (kev->c >= 32 && nc < max_len) {
+						putuchar(kev->c);
+						console_flush(con);
+						buffer[nc++] = kev->c;
+					}
+					break;
+				}
+			}
+		}
+	}
+
+	buffer[nc] = '\0';
+	str = wstr_to_astr(buffer);
+
+	console_set_style(con, STYLE_NORMAL);
+
+	return str;
 }
 
@@ -1060,157 +808,29 @@
 }
 
-/** Initialize pane.
- *
- * TODO: Replace with pane_create() that allocates the pane.
- *
- * @param window Editor window
- * @param pane Pane
- * @return EOK on success or an error code
- */
-static errno_t pane_init(ui_window_t *window, pane_t *pane)
-{
-	errno_t rc;
-	gfx_rect_t arect;
-
-	pane->control = NULL;
-	pane->color = NULL;
-	pane->sel_color = NULL;
-
-	rc = ui_control_new(&pane_ctl_ops, (void *) pane, &pane->control);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x07, &pane->color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x1e, &pane->sel_color);
-	if (rc != EOK)
-		goto error;
-
-	pane->res = ui_window_get_res(window);
-	pane->window = window;
-
-	ui_window_get_app_rect(window, &arect);
-	pane->rect.p0.x = arect.p0.x;
-	pane->rect.p0.y = arect.p0.y + 1;
-	pane->rect.p1.x = arect.p1.x;
-	pane->rect.p1.y = arect.p1.y - 1;
-
-	pane->columns = pane->rect.p1.x - pane->rect.p0.x;
-	pane->rows = pane->rect.p1.y - pane->rect.p0.y;
-
-	return EOK;
-error:
-	if (pane->control != NULL) {
-		ui_control_delete(pane->control);
-		pane->control = NULL;
-	}
-
-	if (pane->color != NULL) {
-		gfx_color_delete(pane->color);
-		pane->color = NULL;
-	}
-
-	return rc;
-}
-
-/** Finalize pane.
- *
- * TODO: Replace with pane_destroy() that deallocates the pane.
- *
- * @param pane Pane
- */
-static void pane_fini(pane_t *pane)
-{
-	gfx_color_delete(pane->color);
-	pane->color = NULL;
-	gfx_color_delete(pane->sel_color);
-	pane->sel_color = NULL;
-	ui_control_delete(pane->control);
-	pane->control = NULL;
-}
-
-/** Return base control object for a pane.
- *
- * @param pane Pane
- * @return Base UI cntrol
- */
-static ui_control_t *pane_ctl(pane_t *pane)
-{
-	return pane->control;
-}
-
-/** Repaint parts of pane that need updating.
- *
- * @param pane Pane
- * @return EOK on succes or an error code
- */
-static errno_t pane_update(pane_t *pane)
-{
-	errno_t rc;
-
-	if (pane->rflags & REDRAW_TEXT) {
-		rc = pane_text_display(pane);
-		if (rc != EOK)
-			return rc;
-	}
-
-	if (pane->rflags & REDRAW_ROW)
-		pane_row_display();
-
-	if (pane->rflags & REDRAW_STATUS)
-		pane_status_display(pane);
-
-	if (pane->rflags & REDRAW_CARET)
-		pane_caret_display(pane);
-
-	pane->rflags &= ~(REDRAW_TEXT | REDRAW_ROW | REDRAW_STATUS |
-	    REDRAW_CARET);
-	return EOK;
-}
-
-/** Display pane text.
- *
- * @param pane Pane
- * @return EOK on success or an error code
- */
-static errno_t pane_text_display(pane_t *pane)
-{
-	gfx_rect_t rect;
-	gfx_context_t *gc;
-	errno_t rc;
+static void pane_text_display(void)
+{
 	int sh_rows, rows;
 
 	sheet_get_num_rows(doc.sh, &sh_rows);
-	rows = min(sh_rows - pane->sh_row + 1, pane->rows);
+	rows = min(sh_rows - pane.sh_row + 1, pane.rows);
 
 	/* Draw rows from the sheet. */
 
-	rc = pane_row_range_display(pane, 0, rows);
-	if (rc != EOK)
-		return rc;
+	console_set_pos(con, 0, 0);
+	pane_row_range_display(0, rows);
 
 	/* Clear the remaining rows if file is short. */
 
-	gc = ui_window_get_gc(pane->window);
-
-	rc = gfx_set_color(gc, pane->color);
-	if (rc != EOK)
-		goto error;
-
-	rect.p0.x = pane->rect.p0.x;
-	rect.p0.y = pane->rect.p0.y + rows;
-	rect.p1.x = pane->rect.p1.x;
-	rect.p1.y = pane->rect.p1.y;
-
-	rc = gfx_fill_rect(gc, &rect);
-	if (rc != EOK)
-		goto error;
-
-	pane->rflags &= ~REDRAW_ROW;
-	return EOK;
-error:
-	return rc;
+	int i;
+	sysarg_t j;
+	for (i = rows; i < pane.rows; ++i) {
+		console_set_pos(con, 0, i);
+		for (j = 0; j < scr_columns; ++j)
+			putchar(' ');
+		console_flush(con);
+	}
+
+	pane.rflags |= (REDRAW_STATUS | REDRAW_CARET);
+	pane.rflags &= ~REDRAW_ROW;
 }
 
@@ -1226,45 +846,25 @@
 
 	ridx = coord.row - pane.sh_row;
-	(void) pane_row_range_display(&pane, ridx, ridx + 1);
+	pane_row_range_display(ridx, ridx + 1);
 	pane.rflags |= (REDRAW_STATUS | REDRAW_CARET);
 }
 
-/** Display a range of rows of text.
- *
- * @param r0 Start row (inclusive)
- * @param r1 End row (exclusive)
- * @return EOk on success or an error code
- */
-static errno_t pane_row_range_display(pane_t *pane, int r0, int r1)
-{
-	int i, fill;
+static void pane_row_range_display(int r0, int r1)
+{
+	int i, j, fill;
 	spt_t rb, re, dep, pt;
 	coord_t rbc, rec;
 	char row_buf[ROW_BUF_SIZE];
-	char cbuf[STR_BOUNDS(1) + 1];
 	char32_t c;
 	size_t pos, size;
-	size_t cpos;
 	int s_column;
 	coord_t csel_start, csel_end, ctmp;
-	gfx_font_t *font;
-	gfx_context_t *gc;
-	gfx_text_fmt_t fmt;
-	gfx_coord2_t tpos;
-	gfx_rect_t rect;
-	errno_t rc;
-
-	font = ui_resource_get_font(edit.ui_res);
-	gc = ui_window_get_gc(edit.window);
-
-	gfx_text_fmt_init(&fmt);
-	fmt.color = pane->color;
 
 	/* Determine selection start and end. */
 
-	tag_get_pt(&pane->sel_start, &pt);
+	tag_get_pt(&pane.sel_start, &pt);
 	spt_get_coord(&pt, &csel_start);
 
-	tag_get_pt(&pane->caret_pos, &pt);
+	tag_get_pt(&pane.caret_pos, &pt);
 	spt_get_coord(&pt, &csel_end);
 
@@ -1277,16 +877,14 @@
 	/* Draw rows from the sheet. */
 
+	console_set_pos(con, 0, 0);
 	for (i = r0; i < r1; ++i) {
-		tpos.x = pane->rect.p0.x;
-		tpos.y = pane->rect.p0.y + i;
-
 		/* Starting point for row display */
-		rbc.row = pane->sh_row + i;
-		rbc.column = pane->sh_column;
+		rbc.row = pane.sh_row + i;
+		rbc.column = pane.sh_column;
 		sheet_get_cell_pt(doc.sh, &rbc, dir_before, &rb);
 
 		/* Ending point for row display */
-		rec.row = pane->sh_row + i;
-		rec.column = pane->sh_column + pane->columns;
+		rec.row = pane.sh_row + i;
+		rec.column = pane.sh_column + pane.columns;
 		sheet_get_cell_pt(doc.sh, &rec, dir_before, &re);
 
@@ -1298,79 +896,64 @@
 		if (coord_cmp(&csel_start, &rbc) <= 0 &&
 		    coord_cmp(&rbc, &csel_end) < 0) {
-			fmt.color = pane->sel_color;
+			console_flush(con);
+			console_set_style(con, STYLE_SELECTED);
+			console_flush(con);
 		}
 
+		console_set_pos(con, 0, i);
 		size = str_size(row_buf);
 		pos = 0;
-		s_column = pane->sh_column;
+		s_column = pane.sh_column;
 		while (pos < size) {
-			if ((csel_start.row == rbc.row) && (csel_start.column == s_column))
-				fmt.color = pane->sel_color;
-
-			if ((csel_end.row == rbc.row) && (csel_end.column == s_column))
-				fmt.color = pane->color;
+			if ((csel_start.row == rbc.row) && (csel_start.column == s_column)) {
+				console_flush(con);
+				console_set_style(con, STYLE_SELECTED);
+				console_flush(con);
+			}
+
+			if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) {
+				console_flush(con);
+				console_set_style(con, STYLE_NORMAL);
+				console_flush(con);
+			}
 
 			c = str_decode(row_buf, &pos, size);
 			if (c != '\t') {
-				cpos = 0;
-				rc = chr_encode(c, cbuf, &cpos, sizeof(cbuf));
-				if (rc != EOK)
-					return rc;
-
-				rc = gfx_puttext(font, &tpos, &fmt, cbuf);
-				if (rc != EOK)
-					return rc;
-
+				printf("%lc", (wint_t) c);
 				s_column += 1;
-				tpos.x++;
 			} else {
 				fill = 1 + ALIGN_UP(s_column, TAB_WIDTH) -
 				    s_column;
 
-				rc = gfx_set_color(gc, fmt.color);
-				if (rc != EOK)
-					return rc;
-
-				rect.p0.x = tpos.x;
-				rect.p0.y = tpos.y;
-				rect.p1.x = tpos.x + fill;
-				rect.p1.y = tpos.y + 1;
-
-				rc = gfx_fill_rect(gc, &rect);
-				if (rc != EOK)
-					return rc;
-
+				for (j = 0; j < fill; ++j)
+					putchar(' ');
 				s_column += fill;
-				tpos.x += fill;
 			}
 		}
 
-		if ((csel_end.row == rbc.row) && (csel_end.column == s_column))
-			fmt.color = pane->color;
+		if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) {
+			console_flush(con);
+			console_set_style(con, STYLE_NORMAL);
+			console_flush(con);
+		}
 
 		/* Fill until the end of display area. */
 
-		rc = gfx_set_color(gc, fmt.color);
-		if (rc != EOK)
-			return rc;
-
-		rect.p0.x = tpos.x;
-		rect.p0.y = tpos.y;
-		rect.p1.x = pane->rect.p1.x;
-		rect.p1.y = tpos.y + 1;
-
-		rc = gfx_fill_rect(gc, &rect);
-		if (rc != EOK)
-			return rc;
-	}
-
-	return EOK;
-}
-
-/** Display pane status in the status line.
- *
- * @param pane Pane
- */
-static void pane_status_display(pane_t *pane)
+		if ((unsigned)s_column - 1 < scr_columns)
+			fill = scr_columns - (s_column - 1);
+		else
+			fill = 0;
+
+		for (j = 0; j < fill; ++j)
+			putchar(' ');
+		console_flush(con);
+		console_set_style(con, STYLE_NORMAL);
+	}
+
+	pane.rflags |= REDRAW_CARET;
+}
+
+/** Display pane status in the status line. */
+static void pane_status_display(void)
 {
 	spt_t caret_pt;
@@ -1381,8 +964,9 @@
 	char *text;
 	size_t n;
+	int pos;
 	size_t nextra;
 	size_t fnw;
 
-	tag_get_pt(&pane->caret_pos, &caret_pt);
+	tag_get_pt(&pane.caret_pos, &caret_pt);
 	spt_get_coord(&caret_pt, &coord);
 
@@ -1403,4 +987,7 @@
 		return;
 
+	console_set_pos(con, 0, scr_rows - 1);
+	console_set_style(con, STYLE_INVERTED);
+
 	/*
 	 * Make sure the status fits on the screen. This loop should
@@ -1408,5 +995,5 @@
 	 */
 	while (true) {
-		int rc = asprintf(&text, "%d, %d (%d): File '%s'. Ctrl-Q Quit  Ctrl-S Save  "
+		int rc = asprintf(&text, " %d, %d (%d): File '%s'. Ctrl-Q Quit  Ctrl-S Save  "
 		    "Ctrl-E Save As", coord.row, coord.column, last_row, fname);
 		if (rc < 0) {
@@ -1417,9 +1004,9 @@
 		/* If it already fits, we're done */
 		n = str_width(text);
-		if ((int)n <= pane->columns - 2)
+		if (n <= scr_columns - 2)
 			break;
 
 		/* Compute number of excess characters */
-		nextra = n - (pane->columns - 2);
+		nextra = n - (scr_columns - 2);
 		/** With of the file name part */
 		fnw = str_width(fname);
@@ -1429,8 +1016,6 @@
 		 * just give up and print a blank status.
 		 */
-		if (nextra > fnw - 2) {
-			text[0] = '\0';
+		if (nextra > fnw - 2)
 			goto finish;
-		}
 
 		/* Compute position where we overwrite with '..\0' */
@@ -1449,86 +1034,28 @@
 	}
 
-finish:
-	(void) ui_label_set_text(edit.status, text);
-	(void) ui_label_paint(edit.status);
+	printf("%s", text);
 	free(text);
 	free(fname);
-}
-
-/** Set cursor to reflect position of the caret.
- *
- * @param pane Pane
- */
-static void pane_caret_display(pane_t *pane)
+finish:
+	/* Fill the rest of the line */
+	pos = scr_columns - 1 - n;
+	printf("%*s", pos, "");
+	console_flush(con);
+	console_set_style(con, STYLE_NORMAL);
+
+	pane.rflags |= REDRAW_CARET;
+}
+
+/** Set cursor to reflect position of the caret. */
+static void pane_caret_display(void)
 {
 	spt_t caret_pt;
 	coord_t coord;
-	gfx_coord2_t pos;
-	gfx_context_t *gc;
-
-	tag_get_pt(&pane->caret_pos, &caret_pt);
+
+	tag_get_pt(&pane.caret_pos, &caret_pt);
 
 	spt_get_coord(&caret_pt, &coord);
-
-	gc = ui_window_get_gc(edit.window);
-	pos.x = pane->rect.p0.x + coord.column - pane->sh_column;
-	pos.y = pane->rect.p0.y + coord.row - pane->sh_row;
-
-	(void) gfx_cursor_set_pos(gc, &pos);
-}
-
-/** Destroy pane control.
- *
- * @param arg Argument (pane_t *)
- */
-static void pane_ctl_destroy(void *arg)
-{
-	pane_t *pane = (pane_t *)arg;
-
-	pane_fini(pane);
-}
-
-/** Paint pane control.
- *
- * @param arg Argument (pane_t *)
- */
-static errno_t pane_ctl_paint(void *arg)
-{
-	pane_t *pane = (pane_t *)arg;
-	gfx_context_t *gc;
-	errno_t rc;
-
-	gc = ui_window_get_gc(pane->window);
-
-	rc = pane_text_display(pane);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_update(gc);
-	if (rc != EOK)
-		goto error;
-
-error:
-	return rc;
-}
-
-/** Handle pane control position event.
- *
- * @param arg Argument (pane_t *)
- * @param event Position event
- */
-static ui_evclaim_t pane_ctl_pos_event(void *arg, pos_event_t *event)
-{
-	gfx_coord2_t pos;
-
-	pos.x = event->hpos;
-	pos.y = event->vpos;
-
-	if (!gfx_pix_inside_rect(&pos, &pane.rect))
-		return ui_unclaimed;
-
-	pos_handle(event);
-	(void) gfx_update(ui_window_get_gc(edit.window));
-	return ui_claimed;
+	console_set_pos(con, coord.column - pane.sh_column,
+	    coord.row - pane.sh_row);
 }
 
@@ -1743,19 +1270,22 @@
 static void caret_go_to_line_ask(void)
 {
-	ui_prompt_dialog_params_t pdparams;
-	ui_prompt_dialog_t *dialog;
-	errno_t rc;
-
-	ui_prompt_dialog_params_init(&pdparams);
-	pdparams.caption = "Go To Line";
-	pdparams.prompt = "Line Number";
-
-	rc = ui_prompt_dialog_create(edit.ui, &pdparams, &dialog);
-	if (rc != EOK) {
-		printf("Error creating prompt dialog.\n");
+	char *sline;
+
+	sline = prompt("Go to line", "");
+	if (sline == NULL) {
+		status_display("Go to line cancelled.");
 		return;
 	}
 
-	ui_prompt_dialog_set_cb(dialog, &go_to_line_dialog_cb, &edit);
+	char *endptr;
+	int line = strtol(sline, &endptr, 10);
+	if (*endptr != '\0') {
+		free(sline);
+		status_display("Invalid number entered.");
+		return;
+	}
+	free(sline);
+
+	caret_move_absolute(line, pane.ideal_column, dir_before, false);
 }
 
@@ -1814,24 +1344,26 @@
 static void search_prompt(bool reverse)
 {
-	ui_prompt_dialog_params_t pdparams;
-	ui_prompt_dialog_t *dialog;
-	errno_t rc;
-
-	ui_prompt_dialog_params_init(&pdparams);
-	pdparams.caption = reverse ? "Reverse Search" : "Search";
-	pdparams.prompt = "Search text";
-	pdparams.itext = "";
-
+	char *pattern;
+
+	const char *prompt_text = "Find next";
+	if (reverse)
+		prompt_text = "Find previous";
+
+	const char *default_value = "";
 	if (pane.previous_search)
-		pdparams.itext = pane.previous_search;
-
-	rc = ui_prompt_dialog_create(edit.ui, &pdparams, &dialog);
-	if (rc != EOK) {
-		printf("Error creating prompt dialog.\n");
+		default_value = pane.previous_search;
+
+	pattern = prompt(prompt_text, default_value);
+	if (pattern == NULL) {
+		status_display("Search cancelled.");
 		return;
 	}
 
-	ui_prompt_dialog_set_cb(dialog, &search_dialog_cb, &edit);
-	pane.search_reverse = reverse;
+	if (pane.previous_search)
+		free(pane.previous_search);
+	pane.previous_search = pattern;
+	pane.previous_search_reverse = reverse;
+
+	search(pattern, reverse);
 }
 
@@ -1981,20 +1513,4 @@
 	}
 	free(str);
-}
-
-static void edit_paste(void)
-{
-	selection_delete();
-	insert_clipboard_data();
-	pane.rflags |= (REDRAW_TEXT | REDRAW_CARET);
-	pane_update(&pane);
-}
-
-static void edit_cut(void)
-{
-	selection_copy();
-	selection_delete();
-	pane.rflags |= (REDRAW_TEXT | REDRAW_CARET);
-	pane_update(&pane);
 }
 
@@ -2203,393 +1719,13 @@
 static void status_display(char const *str)
 {
-	(void) ui_label_set_text(edit.status, str);
-	(void) ui_label_paint(edit.status);
-}
-
-/** Window close request
- *
- * @param window Window
- * @param arg Argument (edit_t *)
- */
-static void edit_wnd_close(ui_window_t *window, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-
-	ui_quit(edit->ui);
-}
-
-/** Window keyboard event
- *
- * @param window Window
- * @param arg Argument (edit_t *)
- * @param event Keyboard event
- */
-static void edit_wnd_kbd_event(ui_window_t *window, void *arg,
-    kbd_event_t *event)
-{
-	pane.keymod = event->mods;
-
-	if (event->type == KEY_PRESS) {
-		key_handle_press(event);
-		(void) pane_update(&pane);
-		(void) gfx_update(ui_window_get_gc(window));
-	}
-}
-
-/** File / Save menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_file_save(ui_menu_entry_t *mentry, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-
-	(void)edit;
-
-	if (doc.file_name != NULL)
-		file_save(doc.file_name);
-	else
-		file_save_as();
-}
-
-/** File / Save As menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_file_save_as(ui_menu_entry_t *mentry, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-
-	(void)edit;
-	file_save_as();
-}
-
-/** File / Exit menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_file_exit(ui_menu_entry_t *mentry, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-
-	ui_quit(edit->ui);
-}
-
-/** Edit / Cut menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_edit_cut(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-	edit_cut();
-	(void) gfx_update(ui_window_get_gc(edit.window));
-}
-
-/** Edit / Copy menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_edit_copy(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-	selection_copy();
-}
-
-/** Edit / Paste menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_edit_paste(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-	edit_paste();
-	(void) gfx_update(ui_window_get_gc(edit.window));
-}
-
-/** Edit / Delete menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_edit_delete(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-
-	if (selection_active())
-		selection_delete();
+	console_set_pos(con, 0, scr_rows - 1);
+	console_set_style(con, STYLE_INVERTED);
+
+	int pos = -(scr_columns - 3);
+	printf(" %*s ", pos, str);
+	console_flush(con);
+	console_set_style(con, STYLE_NORMAL);
 
 	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	(void) gfx_update(ui_window_get_gc(edit.window));
-}
-
-/** Edit / Select All menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_edit_select_all(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-
-	selection_sel_all();
-	pane.rflags |= (REDRAW_CARET | REDRAW_TEXT | REDRAW_STATUS);
-	pane_update(&pane);
-	(void) gfx_update(ui_window_get_gc(edit.window));
-}
-
-/** Search / Find menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_search_find(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-	search_prompt(false);
-}
-
-/** Search / Reverse Find menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_search_reverse_find(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-	search_prompt(true);
-}
-
-/** Search / Find Next menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_search_find_next(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-	search_repeat();
-	(void) pane_update(&pane);
-	(void) gfx_update(ui_window_get_gc(edit.window));
-}
-
-/** Search / Go To Line menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (edit_t *)
- */
-static void edit_search_go_to_line(ui_menu_entry_t *mentry, void *arg)
-{
-	(void) arg;
-	caret_go_to_line_ask();
-}
-
-/** Save As dialog OK button press.
- *
- * @param dialog Save As dialog
- * @param arg Argument (ui_demo_t *)
- * @param fname File name
- */
-static void save_as_dialog_bok(ui_file_dialog_t *dialog, void *arg,
-    const char *fname)
-{
-	edit_t *edit = (edit_t *)arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-	char *cname;
-	errno_t rc;
-
-	ui_file_dialog_destroy(dialog);
-	// TODO Smarter cursor management
-	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-
-	cname = str_dup(fname);
-	if (cname == NULL) {
-		printf("Out of memory.\n");
-		return;
-	}
-
-	rc = file_save(fname);
-	if (rc != EOK)
-		return;
-
-	if (doc.file_name != NULL)
-		free(doc.file_name);
-	doc.file_name = cname;
-
-}
-
-/** Save As dialog cancel button press.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void save_as_dialog_bcancel(ui_file_dialog_t *dialog, void *arg)
-{
-	edit_t *edit = (edit_t *)arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-
-	ui_file_dialog_destroy(dialog);
-	// TODO Smarter cursor management
-	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-}
-
-/** Save As dialog close request.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void save_as_dialog_close(ui_file_dialog_t *dialog, void *arg)
-{
-	edit_t *edit = (edit_t *)arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-
-	ui_file_dialog_destroy(dialog);
-	// TODO Smarter cursor management
-	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-}
-
-/** Go To Line dialog OK button press.
- *
- * @param dialog Go To Line dialog
- * @param arg Argument (ui_demo_t *)
- * @param text Submitted text
- */
-static void go_to_line_dialog_bok(ui_prompt_dialog_t *dialog, void *arg,
-    const char *text)
-{
-	edit_t *edit = (edit_t *) arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-	char *endptr;
-	int line;
-
-	ui_prompt_dialog_destroy(dialog);
-	line = strtol(text, &endptr, 10);
-	if (*endptr != '\0') {
-		status_display("Invalid number entered.");
-		return;
-	}
-
-	caret_move_absolute(line, pane.ideal_column, dir_before, false);
-	// TODO Smarter cursor management
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-	(void) gfx_update(gc);
-}
-
-/** Go To Line dialog cancel button press.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void go_to_line_dialog_bcancel(ui_prompt_dialog_t *dialog, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-
-	ui_prompt_dialog_destroy(dialog);
-	// TODO Smarter cursor management
-	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-}
-
-/** Go To Line dialog close request.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void go_to_line_dialog_close(ui_prompt_dialog_t *dialog, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-
-	ui_prompt_dialog_destroy(dialog);
-	// TODO Smarter cursor management
-	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-}
-
-/** Search dialog OK button press.
- *
- * @param dialog Search dialog
- * @param arg Argument (ui_demo_t *)
- * @param text Submitted text
- */
-static void search_dialog_bok(ui_prompt_dialog_t *dialog, void *arg,
-    const char *text)
-{
-	edit_t *edit = (edit_t *) arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-	char *pattern;
-	bool reverse;
-
-	ui_prompt_dialog_destroy(dialog);
-
-	/* Abort if search phrase is empty */
-	if (text[0] == '\0')
-		return;
-
-	pattern = str_dup(text);
-	reverse = pane.search_reverse;
-
-	if (pane.previous_search)
-		free(pane.previous_search);
-	pane.previous_search = pattern;
-	pane.previous_search_reverse = reverse;
-
-	search(pattern, reverse);
-
-	// TODO Smarter cursor management
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-	(void) gfx_update(gc);
-}
-
-/** Search dialog cancel button press.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void search_dialog_bcancel(ui_prompt_dialog_t *dialog, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-
-	ui_prompt_dialog_destroy(dialog);
-	// TODO Smarter cursor management
-	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
-}
-
-/** Search dialog close request.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void search_dialog_close(ui_prompt_dialog_t *dialog, void *arg)
-{
-	edit_t *edit = (edit_t *) arg;
-	gfx_context_t *gc = ui_window_get_gc(edit->window);
-
-	ui_prompt_dialog_destroy(dialog);
-	// TODO Smarter cursor management
-	pane.rflags |= REDRAW_CARET;
-	(void) pane_update(&pane);
-	gfx_cursor_set_visible(gc, true);
 }
 
Index: uspace/app/edit/meson.build
===================================================================
--- uspace/app/edit/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/edit/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 #
-# Copyright (c) 2021 Jiri Svoboda
 # Copyright (c) 2005 Martin Decky
 # Copyright (c) 2007 Jakub Jermar
@@ -29,5 +28,4 @@
 #
 
-deps = [ 'ui' ]
 src = files(
 	'edit.c',
Index: uspace/app/gfxdemo/gfxdemo.c
===================================================================
--- uspace/app/gfxdemo/gfxdemo.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/gfxdemo/gfxdemo.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -73,16 +73,4 @@
 static gfx_coord_t vpad;
 
-/** Determine if we are running in text mode.
- *
- * @param w Screen width
- * @param h Screen height
- * @return @c true iff we are running in text mode
- */
-static bool demo_is_text(gfx_coord_t w, gfx_coord_t h)
-{
-	// XXX Need a proper way to determine text mode
-	return w <= 80;
-}
-
 /** Clear screen.
  *
@@ -227,13 +215,7 @@
 
 	if (font != NULL) {
-		if (demo_is_text(w, h)) {
-			rc = gfx_color_new_ega(0x1e, &color);
-			if (rc != EOK)
-				goto error;
-		} else {
-			rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
-			if (rc != EOK)
-				goto error;
-		}
+		rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
+		if (rc != EOK)
+			goto error;
 
 		gfx_text_fmt_init(&fmt);
@@ -678,13 +660,7 @@
 	gfx_color_delete(color);
 
-	if (demo_is_text(w, h)) {
-		rc = gfx_color_new_ega(0x1f, &color);
-		if (rc != EOK)
-			goto error;
-	} else {
-		rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
-		if (rc != EOK)
-			goto error;
-	}
+	rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
+	if (rc != EOK)
+		goto error;
 
 	gfx_text_fmt_init(&fmt);
@@ -706,5 +682,5 @@
 		goto error;
 
-	pos.x = rect.p1.x;
+	pos.x = rect.p1.x - 1;
 	pos.y = rect.p0.y;
 	fmt.halign = gfx_halign_right;
@@ -729,5 +705,5 @@
 		goto error;
 
-	pos.x = rect.p1.x;
+	pos.x = rect.p1.x - 1;
 	pos.y = (rect.p0.y + rect.p1.y - 1) / 2;
 	fmt.halign = gfx_halign_right;
@@ -746,5 +722,5 @@
 
 	pos.x = (rect.p0.x + rect.p1.x - 1) / 2;
-	pos.y = rect.p1.y;
+	pos.y = rect.p1.y - 1;
 	fmt.halign = gfx_halign_center;
 	rc = gfx_puttext(font, &pos, &fmt, "Bottom center");
@@ -752,6 +728,6 @@
 		goto error;
 
-	pos.x = rect.p1.x;
-	pos.y = rect.p1.y;
+	pos.x = rect.p1.x - 1;
+	pos.y = rect.p1.y - 1;
 	fmt.halign = gfx_halign_right;
 	rc = gfx_puttext(font, &pos, &fmt, "Bottom right");
@@ -764,14 +740,8 @@
 
 	for (i = 0; i < 8; i++) {
-		if (demo_is_text(w, h)) {
-			rc = gfx_color_new_ega(i != 0 ? i : 0x10, &color);
-			if (rc != EOK)
-				goto error;
-		} else {
-			rc = gfx_color_new_rgb_i16((i & 4) ? 0xffff : 0,
-			    (i & 2) ? 0xffff : 0, (i & 1) ? 0xffff : 0, &color);
-			if (rc != EOK)
-				goto error;
-		}
+		rc = gfx_color_new_rgb_i16((i & 4) ? 0xffff : 0,
+		    (i & 2) ? 0xffff : 0, (i & 1) ? 0xffff : 0, &color);
+		if (rc != EOK)
+			goto error;
 
 		fmt.color = color;
Index: uspace/app/hello/hello.c
===================================================================
--- uspace/app/hello/hello.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/hello/hello.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -80,15 +80,8 @@
 	ui_wnd_params_init(&params);
 	params.caption = "Hello World";
-	if (ui_is_textmode(ui)) {
-		params.rect.p0.x = 0;
-		params.rect.p0.y = 0;
-		params.rect.p1.x = 24;
-		params.rect.p1.y = 5;
-	} else {
-		params.rect.p0.x = 0;
-		params.rect.p0.y = 0;
-		params.rect.p1.x = 200;
-		params.rect.p1.y = 60;
-	}
+	params.rect.p0.x = 0;
+	params.rect.p0.y = 0;
+	params.rect.p1.x = 200;
+	params.rect.p1.y = 60;
 
 	memset((void *) &hello, 0, sizeof(hello));
@@ -118,8 +111,10 @@
 	}
 
-	ui_window_get_app_rect(window, &rect);
+	rect.p0.x = 10;
+	rect.p0.y = 35;
+	rect.p1.x = 190;
+	rect.p1.y = 50;
 	ui_label_set_rect(hello.label, &rect);
 	ui_label_set_halign(hello.label, gfx_halign_center);
-	ui_label_set_valign(hello.label, gfx_valign_center);
 
 	rc = ui_fixed_add(hello.fixed, ui_label_ctl(hello.label));
Index: uspace/app/inet/inet.c
===================================================================
--- uspace/app/inet/inet.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/inet/inet.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -37,5 +37,4 @@
 #include <errno.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include <inet/inetcfg.h>
 #include <io/table.h>
@@ -341,5 +340,4 @@
 	inet_link_info_t linfo;
 	table_t *table = NULL;
-	eth_addr_str_t saddr;
 
 	size_t count;
@@ -370,7 +368,10 @@
 		}
 
-		eth_addr_format(&linfo.mac_addr, &saddr);
-		table_printf(table, "%s\t %s\t %zu\n", saddr.str, linfo.name,
-		    linfo.def_mtu);
+		table_printf(table, "%02x:%02x:%02x:%02x:%02x:%02x\t"
+		    "%s\t" "%zu\n",
+		    linfo.mac_addr[0], linfo.mac_addr[1],
+		    linfo.mac_addr[2], linfo.mac_addr[3],
+		    linfo.mac_addr[4], linfo.mac_addr[5],
+		    linfo.name, linfo.def_mtu);
 
 		free(linfo.name);
Index: uspace/app/tester/meson.build
===================================================================
--- uspace/app/tester/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/tester/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 #
-# Copyright (c) 2021 Jiri Svoboda
 # Copyright (c) 2005 Martin Decky
 # Copyright (c) 2007 Jakub Jermar
@@ -29,5 +28,5 @@
 #
 
-deps = [ 'block', 'codepage', 'drv', 'math' ]
+deps = [ 'block', 'drv', 'math' ]
 src = files(
 	'tester.c',
Index: uspace/app/tester/print/print4.c
===================================================================
--- uspace/app/tester/print/print4.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/tester/print/print4.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2009 Martin Decky
  * All rights reserved.
@@ -28,5 +27,4 @@
  */
 
-#include <codepage/cp437.h>
 #include <stdio.h>
 #include <stddef.h>
@@ -53,22 +51,12 @@
 	}
 
-	/*
-	 * Print entire code page 437 (in Unicode)
-	 *
-	 * The purpose of this test is to verify that the EGA display
-	 * driver can correctly map every code page 437 character back
-	 * from Unicode and display it.
-	 *
-	 * With a Unicode-capable display this will just give you a bit
-	 * of nostalgia.
-	 */
-	TPRINTF("\nCode page 437 characters (converted to Unicode):\n");
+	TPRINTF("\nExtended ASCII characters (128 - 255) using printf(\"%%lc\"):\n");
 
-	for (group = 0; group < 8; group++) {
+	for (group = 4; group < 8; group++) {
 		TPRINTF("%#x: ", group << 5);
 
 		uint8_t index;
 		for (index = 0; index < 32; index++)
-			TPRINTF("%lc", cp437_decode((group << 5) + index));
+			TPRINTF("%lc", (wint_t) ((group << 5) + index));
 
 		TPRINTF("\n");
Index: uspace/app/tetris/screen.c
===================================================================
--- uspace/app/tetris/screen.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/tetris/screen.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -72,6 +72,5 @@
 static int isset;               /* true => terminal is in game mode */
 
-static bool use_rgb;          /* true => use RGB colors */
-static bool use_color;          /* true => use indexed colors */
+static bool use_color;          /* true => use colors */
 
 static const struct shape *lastshape;
@@ -93,21 +92,7 @@
 static void start_standout(uint32_t color)
 {
-	uint8_t bg;
-	uint8_t attr;
-
 	console_flush(console);
-	if (use_rgb) {
-		console_set_rgb_color(console, color, 0xffffff);
-	} else if (use_color) {
-		bg = 0x00;
-		attr = 0;
-		if ((color & 0xff0000) != 0)
-			bg |= 0x4;
-		if ((color & 0x00ff00) != 0)
-			bg |= 0x2;
-		if ((color & 0x0000ff) != 0)
-			bg |= 0x1;
-		console_set_color(console, bg, 0x00, attr);
-	}
+	console_set_rgb_color(console, use_color ? color : 0x000000,
+	    0xffffff);
 }
 
@@ -158,17 +143,13 @@
 }
 
-static void get_display_color_sup(bool *rgb, bool *color)
+static bool get_display_color_sup(void)
 {
 	sysarg_t ccap;
 	errno_t rc = console_get_color_cap(console, &ccap);
 
-	if (rc != EOK) {
-		*rgb = false;
-		*color = false;
-		return;
-	}
-
-	*rgb = ((ccap & CONSOLE_CAP_RGB) == CONSOLE_CAP_RGB);
-	*color = ((ccap & CONSOLE_CAP_INDEXED) == CONSOLE_CAP_INDEXED);
+	if (rc != EOK)
+		return false;
+
+	return ((ccap & CONSOLE_CAP_RGB) == CONSOLE_CAP_RGB);
 }
 
@@ -188,5 +169,5 @@
 	}
 
-	get_display_color_sup(&use_rgb, &use_color);
+	use_color = get_display_color_sup();
 
 	if ((Rows < MINROWS) || (Cols < MINCOLS)) {
Index: uspace/app/uidemo/uidemo.c
===================================================================
--- uspace/app/uidemo/uidemo.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/uidemo/uidemo.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -40,5 +40,4 @@
 #include <str.h>
 #include <ui/entry.h>
-#include <ui/filedialog.h>
 #include <ui/fixed.h>
 #include <ui/image.h>
@@ -49,5 +48,4 @@
 #include <ui/msgdialog.h>
 #include <ui/pbutton.h>
-#include <ui/promptdialog.h>
 #include <ui/resource.h>
 #include <ui/ui.h>
@@ -87,28 +85,6 @@
 };
 
-static void uidemo_file_load(ui_menu_entry_t *, void *);
 static void uidemo_file_message(ui_menu_entry_t *, void *);
 static void uidemo_file_exit(ui_menu_entry_t *, void *);
-static void uidemo_edit_modify(ui_menu_entry_t *, void *);
-
-static void file_dialog_bok(ui_file_dialog_t *, void *, const char *);
-static void file_dialog_bcancel(ui_file_dialog_t *, void *);
-static void file_dialog_close(ui_file_dialog_t *, void *);
-
-static ui_file_dialog_cb_t file_dialog_cb = {
-	.bok = file_dialog_bok,
-	.bcancel = file_dialog_bcancel,
-	.close = file_dialog_close
-};
-
-static void prompt_dialog_bok(ui_prompt_dialog_t *, void *, const char *);
-static void prompt_dialog_bcancel(ui_prompt_dialog_t *, void *);
-static void prompt_dialog_close(ui_prompt_dialog_t *, void *);
-
-static ui_prompt_dialog_cb_t prompt_dialog_cb = {
-	.bok = prompt_dialog_bok,
-	.bcancel = prompt_dialog_bcancel,
-	.close = prompt_dialog_close
-};
 
 static void msg_dialog_button(ui_msg_dialog_t *, void *, unsigned);
@@ -120,11 +96,4 @@
 };
 
-/** Horizontal alignment selected by each radio button */
-static const gfx_halign_t uidemo_halign[3] = {
-	gfx_halign_left,
-	gfx_halign_center,
-	gfx_halign_right
-};
-
 /** Window close button was clicked.
  *
@@ -153,8 +122,10 @@
 		if (rc != EOK)
 			printf("Error changing entry text.\n");
+		(void) ui_entry_paint(demo->entry);
 	} else {
 		rc = ui_entry_set_text(demo->entry, "Cancel pressed");
 		if (rc != EOK)
 			printf("Error changing entry text.\n");
+		(void) ui_entry_paint(demo->entry);
 	}
 }
@@ -168,6 +139,17 @@
 {
 	ui_demo_t *demo = (ui_demo_t *) arg;
-
-	ui_entry_set_read_only(demo->entry, enable);
+	errno_t rc;
+
+	if (enable) {
+		rc = ui_entry_set_text(demo->entry, "Checked");
+		if (rc != EOK)
+			printf("Error changing entry text.\n");
+		(void) ui_entry_paint(demo->entry);
+	} else {
+		rc = ui_entry_set_text(demo->entry, "Unchecked");
+		if (rc != EOK)
+			printf("Error changing entry text.\n");
+		(void) ui_entry_paint(demo->entry);
+	}
 }
 
@@ -181,7 +163,10 @@
 {
 	ui_demo_t *demo = (ui_demo_t *) garg;
-	gfx_halign_t halign = *(gfx_halign_t *) barg;
-
-	ui_entry_set_halign(demo->entry, halign);
+	const char *text = (const char *) barg;
+	errno_t rc;
+
+	rc = ui_entry_set_text(demo->entry, text);
+	if (rc != EOK)
+		printf("Error changing entry text.\n");
 	(void) ui_entry_paint(demo->entry);
 }
@@ -215,55 +200,5 @@
 }
 
-/** Display a message window.
- *
- * @param demo UI demo
- * @param caption Window caption
- * @param text Message text
- */
-static void uidemo_show_message(ui_demo_t *demo, const char *caption,
-    const char *text)
-{
-	ui_msg_dialog_params_t mdparams;
-	ui_msg_dialog_t *dialog;
-	errno_t rc;
-
-	ui_msg_dialog_params_init(&mdparams);
-	mdparams.caption = caption;
-	mdparams.text = text;
-
-	rc = ui_msg_dialog_create(demo->ui, &mdparams, &dialog);
-	if (rc != EOK) {
-		printf("Error creating message dialog.\n");
-		return;
-	}
-
-	ui_msg_dialog_set_cb(dialog, &msg_dialog_cb, &demo);
-}
-
-/** File / Load menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (demo)
- */
-static void uidemo_file_load(ui_menu_entry_t *mentry, void *arg)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-	ui_file_dialog_params_t fdparams;
-	ui_file_dialog_t *dialog;
-	errno_t rc;
-
-	ui_file_dialog_params_init(&fdparams);
-	fdparams.caption = "Load File";
-
-	rc = ui_file_dialog_create(demo->ui, &fdparams, &dialog);
-	if (rc != EOK) {
-		printf("Error creating message dialog.\n");
-		return;
-	}
-
-	ui_file_dialog_set_cb(dialog, &file_dialog_cb, demo);
-}
-
-/** File / Message menu entry selected.
+/** File/message menu entry selected.
  *
  * @param mentry Menu entry
@@ -288,7 +223,8 @@
 
 	ui_msg_dialog_set_cb(dialog, &msg_dialog_cb, &demo);
-}
-
-/** File / Exit menu entry selected.
+
+}
+
+/** File/exit menu entry selected.
  *
  * @param mentry Menu entry
@@ -300,139 +236,4 @@
 
 	ui_quit(demo->ui);
-}
-
-/** Edit / Modify menu entry selected.
- *
- * @param mentry Menu entry
- * @param arg Argument (demo)
- */
-static void uidemo_edit_modify(ui_menu_entry_t *mentry, void *arg)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-	ui_prompt_dialog_params_t pdparams;
-	ui_prompt_dialog_t *dialog;
-	errno_t rc;
-
-	ui_prompt_dialog_params_init(&pdparams);
-	pdparams.caption = "Modify Entry Text";
-	pdparams.prompt = "Enter New Text";
-
-	rc = ui_prompt_dialog_create(demo->ui, &pdparams, &dialog);
-	if (rc != EOK) {
-		printf("Error creating message dialog.\n");
-		return;
-	}
-
-	ui_prompt_dialog_set_cb(dialog, &prompt_dialog_cb, demo);
-}
-
-/** File dialog OK button press.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- * @param fname File name
- */
-static void file_dialog_bok(ui_file_dialog_t *dialog, void *arg,
-    const char *fname)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-	char buf[128];
-	char *p;
-	FILE *f;
-
-	ui_file_dialog_destroy(dialog);
-
-	f = fopen(fname, "rt");
-	if (f == NULL) {
-		uidemo_show_message(demo, "Error", "Error opening file.");
-		return;
-	}
-
-	p = fgets(buf, sizeof(buf), f);
-	if (p == NULL) {
-		uidemo_show_message(demo, "Error", "Error reading file.");
-		fclose(f);
-		return;
-	}
-
-	/* Cut string off at the first non-printable character */
-	p = buf;
-	while (*p != '\0') {
-		if (*p < ' ') {
-			*p = '\0';
-			break;
-		}
-		++p;
-	}
-
-	ui_entry_set_text(demo->entry, buf);
-	fclose(f);
-}
-
-/** File dialog cancel button press.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void file_dialog_bcancel(ui_file_dialog_t *dialog, void *arg)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-
-	(void) demo;
-	ui_file_dialog_destroy(dialog);
-}
-
-/** File dialog close request.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void file_dialog_close(ui_file_dialog_t *dialog, void *arg)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-
-	(void) demo;
-	ui_file_dialog_destroy(dialog);
-}
-
-/** Prompt dialog OK button press.
- *
- * @param dialog Prompt dialog
- * @param arg Argument (ui_demo_t *)
- * @param text Submitted text
- */
-static void prompt_dialog_bok(ui_prompt_dialog_t *dialog, void *arg,
-    const char *text)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-
-	ui_prompt_dialog_destroy(dialog);
-	ui_entry_set_text(demo->entry, text);
-}
-
-/** Prompt dialog cancel button press.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void prompt_dialog_bcancel(ui_prompt_dialog_t *dialog, void *arg)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-
-	(void) demo;
-	ui_prompt_dialog_destroy(dialog);
-}
-
-/** Prompt dialog close request.
- *
- * @param dialog File dialog
- * @param arg Argument (ui_demo_t *)
- */
-static void prompt_dialog_close(ui_prompt_dialog_t *dialog, void *arg)
-{
-	ui_demo_t *demo = (ui_demo_t *) arg;
-
-	(void) demo;
-	ui_prompt_dialog_destroy(dialog);
 }
 
@@ -479,11 +280,8 @@
 	gfx_coord2_t off;
 	ui_menu_entry_t *mmsg;
-	ui_menu_entry_t *mload;
 	ui_menu_entry_t *mfoo;
 	ui_menu_entry_t *mbar;
 	ui_menu_entry_t *mfoobar;
-	ui_menu_entry_t *msep;
 	ui_menu_entry_t *mexit;
-	ui_menu_entry_t *mmodify;
 	ui_menu_entry_t *mabout;
 	errno_t rc;
@@ -506,6 +304,6 @@
 		params.rect.p0.x = 0;
 		params.rect.p0.y = 0;
-		params.rect.p1.x = 44;
-		params.rect.p1.y = 21;
+		params.rect.p1.x = 80;
+		params.rect.p1.y = 25;
 	} else {
 		params.rect.p0.x = 0;
@@ -553,12 +351,4 @@
 	ui_menu_entry_set_cb(mmsg, uidemo_file_message, (void *) &demo);
 
-	rc = ui_menu_entry_create(demo.mfile, "Load", "", &mload);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mload, uidemo_file_load, (void *) &demo);
-
 	rc = ui_menu_entry_create(demo.mfile, "Foo", "Ctrl-Alt-Del", &mfoo);
 	if (rc != EOK) {
@@ -579,5 +369,5 @@
 	}
 
-	rc = ui_menu_entry_sep_create(demo.mfile, &msep);
+	rc = ui_menu_entry_sep_create(demo.mfile, &mexit);
 	if (rc != EOK) {
 		printf("Error creating menu.\n");
@@ -598,12 +388,4 @@
 		return rc;
 	}
-
-	rc = ui_menu_entry_create(demo.medit, "Modify", "", &mmodify);
-	if (rc != EOK) {
-		printf("Error creating menu.\n");
-		return rc;
-	}
-
-	ui_menu_entry_set_cb(mmodify, uidemo_edit_modify, (void *) &demo);
 
 	rc = ui_menu_create(demo.mbar, "Preferences", &demo.mpreferences);
@@ -628,7 +410,7 @@
 	if (ui_is_textmode(ui)) {
 		rect.p0.x = 1;
-		rect.p0.y = 1;
-		rect.p1.x = 43;
-		rect.p1.y = 2;
+		rect.p0.y = 2;
+		rect.p1.x = 79;
+		rect.p1.y = 3;
 	} else {
 		rect.p0.x = 4;
@@ -651,17 +433,8 @@
 	}
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 3;
-		rect.p1.x = 42;
-		rect.p1.y = 4;
-	} else {
-		rect.p0.x = 15;
-		rect.p0.y = 53;
-		rect.p1.x = 205;
-		rect.p1.y = 78;
-	}
-
+	rect.p0.x = 15;
+	rect.p0.y = 53;
+	rect.p1.x = 205;
+	rect.p1.y = 78;
 	ui_entry_set_rect(demo.entry, &rect);
 	ui_entry_set_halign(demo.entry, gfx_halign_center);
@@ -679,17 +452,8 @@
 	}
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 5;
-		rect.p1.x = 42;
-		rect.p1.y = 6;
-	} else {
-		rect.p0.x = 60;
-		rect.p0.y = 88;
-		rect.p1.x = 160;
-		rect.p1.y = 101;
-	}
-
+	rect.p0.x = 60;
+	rect.p0.y = 88;
+	rect.p1.x = 160;
+	rect.p1.y = 101;
 	ui_label_set_rect(demo.label, &rect);
 	ui_label_set_halign(demo.label, gfx_halign_center);
@@ -709,17 +473,8 @@
 	ui_pbutton_set_cb(demo.pb1, &pbutton_cb, (void *) &demo);
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 7;
-		rect.p1.x = 12;
-		rect.p1.y = 8;
-	} else {
-		rect.p0.x = 15;
-		rect.p0.y = 111;
-		rect.p1.x = 105;
-		rect.p1.y = 139;
-	}
-
+	rect.p0.x = 15;
+	rect.p0.y = 111;
+	rect.p1.x = 105;
+	rect.p1.y = 139;
 	ui_pbutton_set_rect(demo.pb1, &rect);
 
@@ -740,16 +495,8 @@
 	ui_pbutton_set_cb(demo.pb2, &pbutton_cb, (void *) &demo);
 
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 32;
-		rect.p0.y = 7;
-		rect.p1.x = 42;
-		rect.p1.y = 8;
-	} else {
-		rect.p0.x = 115;
-		rect.p0.y = 111;
-		rect.p1.x = 205;
-		rect.p1.y = 139;
-	}
-
+	rect.p0.x = 115;
+	rect.p0.y = 111;
+	rect.p1.x = 205;
+	rect.p1.y = 139;
 	ui_pbutton_set_rect(demo.pb2, &rect);
 
@@ -761,15 +508,8 @@
 
 	gfx_bitmap_params_init(&bparams);
-	if (ui_is_textmode(ui)) {
-		bparams.rect.p0.x = 0;
-		bparams.rect.p0.y = 0;
-		bparams.rect.p1.x = 40;
-		bparams.rect.p1.y = 2;
-	} else {
-		bparams.rect.p0.x = 0;
-		bparams.rect.p0.y = 0;
-		bparams.rect.p1.x = 188;
-		bparams.rect.p1.y = 24;
-	}
+	bparams.rect.p0.x = 0;
+	bparams.rect.p0.y = 0;
+	bparams.rect.p1.x = 188;
+	bparams.rect.p1.y = 24;
 
 	rc = gfx_bitmap_create(gc, &bparams, NULL, &bitmap);
@@ -787,22 +527,13 @@
 	}
 
-	if (ui_is_textmode(ui)) {
-		off.x = 2;
-		off.y = 9;
-	} else {
-		off.x = 15;
-		off.y = 155;
-	}
-
+	off.x = 15;
+	off.y = 155;
 	gfx_rect_translate(&off, &bparams.rect, &rect);
 
 	/* Adjust for frame width (2 x 1 pixel) */
-	if (!ui_is_textmode(ui)) {
-		ui_image_set_flags(demo.image, ui_imgf_frame);
-		rect.p1.x += 2;
-		rect.p1.y += 2;
-	}
-
+	rect.p1.x += 2;
+	rect.p1.y += 2;
 	ui_image_set_rect(demo.image, &rect);
+	ui_image_set_flags(demo.image, ui_imgf_frame);
 
 	rc = ui_fixed_add(demo.fixed, ui_image_ctl(demo.image));
@@ -812,5 +543,5 @@
 	}
 
-	rc = ui_checkbox_create(ui_res, "Read only", &demo.checkbox);
+	rc = ui_checkbox_create(ui_res, "Check me", &demo.checkbox);
 	if (rc != EOK) {
 		printf("Error creating check box.\n");
@@ -820,17 +551,8 @@
 	ui_checkbox_set_cb(demo.checkbox, &checkbox_cb, (void *) &demo);
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 12;
-		rect.p1.x = 12;
-		rect.p1.y = 13;
-	} else {
-		rect.p0.x = 15;
-		rect.p0.y = 190;
-		rect.p1.x = 140;
-		rect.p1.y = 210;
-	}
-
+	rect.p0.x = 15;
+	rect.p0.y = 190;
+	rect.p1.x = 140;
+	rect.p1.y = 210;
 	ui_checkbox_set_rect(demo.checkbox, &rect);
 
@@ -847,6 +569,6 @@
 	}
 
-	rc = ui_rbutton_create(demo.rbgroup, "Left", (void *) &uidemo_halign[0],
-	    &demo.rbleft);
+	rc = ui_rbutton_create(demo.rbgroup, "Option 1", (void *) "First",
+	    &demo.rb1);
 	if (rc != EOK) {
 		printf("Error creating radio button.\n");
@@ -857,26 +579,18 @@
 	    (void *) &demo);
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 14;
-		rect.p1.x = 12;
-		rect.p1.y = 15;
-	} else {
-		rect.p0.x = 15;
-		rect.p0.y = 220;
-		rect.p1.x = 140;
-		rect.p1.y = 240;
-	}
-	ui_rbutton_set_rect(demo.rbleft, &rect);
-
-	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rbleft));
-	if (rc != EOK) {
-		printf("Error adding control to layout.\n");
-		return rc;
-	}
-
-	rc = ui_rbutton_create(demo.rbgroup, "Center", (void *) &uidemo_halign[1],
-	    &demo.rbcenter);
+	rect.p0.x = 15;
+	rect.p0.y = 220;
+	rect.p1.x = 140;
+	rect.p1.y = 240;
+	ui_rbutton_set_rect(demo.rb1, &rect);
+
+	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rb1));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	rc = ui_rbutton_create(demo.rbgroup, "Option 2", (void *) "Second",
+	    &demo.rb2);
 	if (rc != EOK) {
 		printf("Error creating radio button.\n");
@@ -884,27 +598,18 @@
 	}
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 15;
-		rect.p1.x = 12;
-		rect.p1.y = 16;
-	} else {
-		rect.p0.x = 15;
-		rect.p0.y = 250;
-		rect.p1.x = 140;
-		rect.p1.y = 270;
-	}
-	ui_rbutton_set_rect(demo.rbcenter, &rect);
-	ui_rbutton_select(demo.rbcenter);
-
-	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rbcenter));
-	if (rc != EOK) {
-		printf("Error adding control to layout.\n");
-		return rc;
-	}
-
-	rc = ui_rbutton_create(demo.rbgroup, "Right", (void *) &uidemo_halign[2],
-	    &demo.rbright);
+	rect.p0.x = 15;
+	rect.p0.y = 250;
+	rect.p1.x = 140;
+	rect.p1.y = 270;
+	ui_rbutton_set_rect(demo.rb2, &rect);
+
+	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rb2));
+	if (rc != EOK) {
+		printf("Error adding control to layout.\n");
+		return rc;
+	}
+
+	rc = ui_rbutton_create(demo.rbgroup, "Option 3", (void *) "Third",
+	    &demo.rb3);
 	if (rc != EOK) {
 		printf("Error creating radio button.\n");
@@ -912,19 +617,11 @@
 	}
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 16;
-		rect.p1.x = 12;
-		rect.p1.y = 17;
-	} else {
-		rect.p0.x = 15;
-		rect.p0.y = 280;
-		rect.p1.x = 140;
-		rect.p1.y = 300;
-	}
-	ui_rbutton_set_rect(demo.rbright, &rect);
-
-	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rbright));
+	rect.p0.x = 15;
+	rect.p0.y = 280;
+	rect.p1.x = 140;
+	rect.p1.y = 300;
+	ui_rbutton_set_rect(demo.rb3, &rect);
+
+	rc = ui_fixed_add(demo.fixed, ui_rbutton_ctl(demo.rb3));
 	if (rc != EOK) {
 		printf("Error adding control to layout.\n");
@@ -940,17 +637,8 @@
 	ui_slider_set_cb(demo.slider, &slider_cb, (void *) &demo);
 
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 2;
-		rect.p0.y = 18;
-		rect.p1.x = 12;
-		rect.p1.y = 19;
-	} else {
-		rect.p0.x = 15;
-		rect.p0.y = 310;
-		rect.p1.x = 130;
-		rect.p1.y = 330;
-	}
-
+	rect.p0.x = 15;
+	rect.p0.y = 310;
+	rect.p1.x = 130;
+	rect.p1.y = 330;
 	ui_slider_set_rect(demo.slider, &rect);
 
@@ -1005,5 +693,5 @@
 			k = i * i + j * j;
 			pixelmap_put_pixel(&pixelmap, i, j,
-			    PIXEL(0, k, k, 255 - k));
+			    PIXEL(255, k, k, 255 - k));
 		}
 	}
Index: uspace/app/uidemo/uidemo.h
===================================================================
--- uspace/app/uidemo/uidemo.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/app/uidemo/uidemo.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -67,7 +67,7 @@
 	ui_checkbox_t *checkbox;
 	ui_rbutton_group_t *rbgroup;
-	ui_rbutton_t *rbleft;
-	ui_rbutton_t *rbcenter;
-	ui_rbutton_t *rbright;
+	ui_rbutton_t *rb1;
+	ui_rbutton_t *rb2;
+	ui_rbutton_t *rb3;
 	ui_slider_t *slider;
 } ui_demo_t;
Index: uspace/drv/char/i8042/i8042.h
===================================================================
--- uspace/drv/char/i8042/i8042.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/drv/char/i8042/i8042.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2006 Josef Cejka
  * Copyright (c) 2011 Jan Vesely
+ * Copyright (c) 2017 Jiri Svoboda
  * All rights reserved.
  *
@@ -48,8 +48,5 @@
 #define NAME  "i8042"
 
-/** Buffer needs to be large enough for rate at which keyboard or mouse
- * produces data (mouse produces data at faster rate).
- */
-#define BUFFER_SIZE  64
+#define BUFFER_SIZE  12
 
 /** i8042 HW I/O interface */
Index: uspace/drv/meson.build
===================================================================
--- uspace/drv/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/drv/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -78,5 +78,4 @@
 	'platform/amdm37x',
 	'platform/arm64virt',
-	'platform/hikey960',
 	'platform/icp',
 	'platform/mac',
Index: pace/drv/platform/hikey960/hikey960.c
===================================================================
--- uspace/drv/platform/hikey960/hikey960.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,270 +1,0 @@
-/*
- * Copyright (c) 2021 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @addtogroup hikey960
- * @{
- */
-
-/** @file
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <errno.h>
-#include <stdbool.h>
-#include <stdlib.h>
-
-#include <ddf/driver.h>
-#include <ddf/log.h>
-#include <ops/hw_res.h>
-#include <ops/pio_window.h>
-
-#define NAME  "hikey960"
-
-enum {
-	hikey960_ic_distr_membase = 0xE82B1000,
-	hikey960_ic_distr_memsize = 0x00001000,
-	hikey960_ic_cpui_membase = 0xE82B2000,
-	hikey960_ic_cpui_memsize = 0x00001004,
-	hikey960_uart_irq = 111,
-	hikey960_uart_membase = 0xFFF32000,
-	hikey960_uart_memsize = 0x00001000
-};
-
-typedef struct hikey960_fun {
-	hw_resource_list_t hw_resources;
-} hikey960_fun_t;
-
-static errno_t hikey960_dev_add(ddf_dev_t *);
-
-static driver_ops_t hikey960_ops = {
-	.dev_add = &hikey960_dev_add
-};
-
-static driver_t hikey960_driver = {
-	.name = NAME,
-	.driver_ops = &hikey960_ops
-};
-
-static hw_resource_t hikey960_ic_res[] = {
-	{
-		.type = MEM_RANGE,
-		.res.mem_range = {
-			.address = hikey960_ic_distr_membase,
-			.size = hikey960_ic_distr_memsize,
-			.relative = false,
-			.endianness = LITTLE_ENDIAN
-		}
-	},
-	{
-		.type = MEM_RANGE,
-		.res.mem_range = {
-			.address = hikey960_ic_cpui_membase,
-			.size = hikey960_ic_cpui_memsize,
-			.relative = false,
-			.endianness = LITTLE_ENDIAN
-		}
-	}
-};
-
-static hw_resource_t hikey960_uart_res[] = {
-	{
-		.type = MEM_RANGE,
-		.res.mem_range = {
-			.address = hikey960_uart_membase,
-			.size = hikey960_uart_memsize,
-			.relative = false,
-			.endianness = LITTLE_ENDIAN
-		}
-	},
-	{
-		.type = INTERRUPT,
-		.res.interrupt = {
-			.irq = hikey960_uart_irq
-		}
-	}
-};
-
-static pio_window_t hikey960_pio_window = {
-	.mem = {
-		.base = 0,
-		.size = -1
-	}
-};
-
-static hikey960_fun_t hikey960_ic_fun_proto = {
-	.hw_resources = {
-		sizeof(hikey960_ic_res) / sizeof(hikey960_ic_res[0]),
-		hikey960_ic_res
-	},
-};
-
-static hikey960_fun_t hikey960_uart_fun_proto = {
-	.hw_resources = {
-		sizeof(hikey960_uart_res) / sizeof(hikey960_uart_res[0]),
-		hikey960_uart_res
-	},
-};
-
-/** Obtain function soft-state from DDF function node. */
-static hikey960_fun_t *hikey960_fun(ddf_fun_t *fnode)
-{
-	return ddf_fun_data_get(fnode);
-}
-
-static hw_resource_list_t *hikey960_get_resources(ddf_fun_t *fnode)
-{
-	hikey960_fun_t *fun = hikey960_fun(fnode);
-
-	assert(fun != NULL);
-	return &fun->hw_resources;
-}
-
-static errno_t hikey960_enable_interrupt(ddf_fun_t *fun, int irq)
-{
-	/* TODO */
-	return false;
-}
-
-static pio_window_t *hikey960_get_pio_window(ddf_fun_t *fnode)
-{
-	return &hikey960_pio_window;
-}
-
-static hw_res_ops_t hikey960_hw_res_ops = {
-	.get_resource_list = &hikey960_get_resources,
-	.enable_interrupt = &hikey960_enable_interrupt,
-};
-
-static pio_window_ops_t hikey960_pio_window_ops = {
-	.get_pio_window = &hikey960_get_pio_window
-};
-
-static ddf_dev_ops_t hikey960_fun_ops = {
-	.interfaces = {
-		[HW_RES_DEV_IFACE] = &hikey960_hw_res_ops,
-		[PIO_WINDOW_DEV_IFACE] = &hikey960_pio_window_ops
-	}
-};
-
-static errno_t hikey960_add_fun(ddf_dev_t *dev, const char *name,
-    const char *str_match_id, hikey960_fun_t *fun_proto)
-{
-	ddf_msg(LVL_NOTE, "Adding function '%s'.", name);
-
-	ddf_fun_t *fnode = NULL;
-	errno_t rc;
-
-	/* Create new device. */
-	fnode = ddf_fun_create(dev, fun_inner, name);
-	if (fnode == NULL) {
-		ddf_msg(LVL_ERROR, "Error creating function '%s'.", name);
-		rc = ENOMEM;
-		goto error;
-	}
-
-	hikey960_fun_t *fun = ddf_fun_data_alloc(fnode,
-	    sizeof(hikey960_fun_t));
-	*fun = *fun_proto;
-
-	/* Add match ID. */
-	rc = ddf_fun_add_match_id(fnode, str_match_id, 100);
-	if (rc != EOK) {
-		ddf_msg(LVL_ERROR, "Error adding match ID to function '%s'.",
-		    name);
-		goto error;
-	}
-
-	/* Set provided operations to the device. */
-	ddf_fun_set_ops(fnode, &hikey960_fun_ops);
-
-	/* Register function. */
-	rc = ddf_fun_bind(fnode);
-	if (rc != EOK) {
-		ddf_msg(LVL_ERROR, "Failed binding function '%s'.", name);
-		goto error;
-	}
-
-	return EOK;
-
-error:
-	if (fnode != NULL)
-		ddf_fun_destroy(fnode);
-
-	return rc;
-}
-
-static errno_t hikey960_add_functions(ddf_dev_t *dev)
-{
-	errno_t rc;
-
-	rc = hikey960_add_fun(dev, "intctl", "arm/gicv2",
-	    &hikey960_ic_fun_proto);
-	if (rc != EOK)
-		return rc;
-
-	rc = hikey960_add_fun(dev, "uart", "arm/pl011",
-	    &hikey960_uart_fun_proto);
-	if (rc != EOK)
-		return rc;
-
-	return EOK;
-}
-
-/** Add device. */
-static errno_t hikey960_dev_add(ddf_dev_t *dev)
-{
-	ddf_msg(LVL_NOTE, "hikey960_dev_add(), device=%s.",
-	    ddf_dev_get_name(dev));
-
-	/* Register functions. */
-	if (hikey960_add_functions(dev))
-		ddf_msg(LVL_ERROR, "Failed to add functions for HiKey 960 platform.");
-
-	return EOK;
-}
-
-int main(int argc, char *argv[])
-{
-	errno_t rc;
-
-	printf("%s: HelenOS HiKey 960 platform driver\n", NAME);
-
-	rc = ddf_log_init(NAME);
-	if (rc != EOK) {
-		printf("%s: Failed connecting logging service.", NAME);
-		return 1;
-	}
-
-	return ddf_driver_main(&hikey960_driver);
-}
-
-/**
- * @}
- */
Index: pace/drv/platform/hikey960/hikey960.ma
===================================================================
--- uspace/drv/platform/hikey960/hikey960.ma	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,1 +1,0 @@
-10 platform/hikey960
Index: pace/drv/platform/hikey960/meson.build
===================================================================
--- uspace/drv/platform/hikey960/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#
-# Copyright (c) 2021 Martin Decky
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-src = files('hikey960.c')
Index: uspace/lib/c/generic/io/asprintf.c
===================================================================
--- uspace/lib/c/generic/io/asprintf.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/c/generic/io/asprintf.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -89,5 +89,5 @@
 	va_end(args2);
 
-	if (ret >= 0) {
+	if (ret > 0) {
 		*strp = malloc(ret + 1);
 		if (*strp == NULL)
Index: uspace/lib/c/generic/io/console.c
===================================================================
--- uspace/lib/c/generic/io/console.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/c/generic/io/console.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -290,4 +290,6 @@
 	exch = async_exchange_begin(ctrl->output_sess);
 	req = async_send_2(exch, CONSOLE_MAP, cols, rows, &answer);
+	if (rc != EOK)
+		goto error;
 
 	asize = PAGES2SIZE(SIZE2PAGES(cols * rows * sizeof(charfield_t)));
Index: uspace/lib/c/include/adt/list.h
===================================================================
--- uspace/lib/c/include/adt/list.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/c/include/adt/list.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -89,5 +89,5 @@
 
 #define list_foreach(list, member, itype, iterator) \
-	for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) sizeof(itype)) \
+	for (itype *iterator = NULL; iterator == NULL; iterator = &((itype *) NULL)[1]) \
 		for (link_t *_link = (list).head.next; \
 		    iterator = list_get_instance(_link, itype, member), \
@@ -95,5 +95,5 @@
 
 #define list_foreach_rev(list, member, itype, iterator) \
-	for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) sizeof(itype)) \
+	for (itype *iterator = NULL; iterator == NULL; iterator = &((itype *) NULL)[1]) \
 		for (link_t *_link = (list).head.prev; \
 		    iterator = list_get_instance(_link, itype, member), \
Index: pace/lib/codepage/doc/doxygroups.h
===================================================================
--- uspace/lib/codepage/doc/doxygroups.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,3 +1,0 @@
-/** @addtogroup libcodepage libcodepage
- * @ingroup libs
- */
Index: pace/lib/codepage/include/codepage/cp437.h
===================================================================
--- uspace/lib/codepage/include/codepage/cp437.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcodepage
- * @{
- */
-/**
- * @file Code page 437
- */
-
-#ifndef _CODEPAGE_CP437_H
-#define _CODEPAGE_CP437_H
-
-#include <errno.h>
-#include <stdint.h>
-#include <str.h>
-
-extern char32_t cp437_decode(uint8_t);
-extern errno_t cp437_encode(char32_t, uint8_t *);
-
-#endif
-
-/** @}
- */
Index: pace/lib/codepage/meson.build
===================================================================
--- uspace/lib/codepage/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#
-# Copyright (c) 2021 Jiri Svoboda
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-src = files(
-	'src/cp437.c',
-)
-
-test_src = files(
-	'test/cp437.c',
-	'test/main.c',
-)
Index: pace/lib/codepage/src/cp437.c
===================================================================
--- uspace/lib/codepage/src/cp437.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,328 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcodepage
- * @{
- */
-/**
- * @file Code page 437
- *
- * The ROM fonts of graphics adapters decending from IBM's MDA/CGA
- * use Code Page 437 and provide popular graphic characters
- * (such as box drawing) used in text-based user interfaces.
- */
-
-#include <codepage/cp437.h>
-#include <errno.h>
-#include <stdint.h>
-#include <str.h>
-
-/** All 256 graphic characters of Code Page 437 represented in Unicode */
-static char32_t cp437[256] = {
-	/* 0x */
-	L'\x0000', L'\x263a', L'\x263b', L'\x2665',
-	L'\x2666', L'\x2663', L'\x2660', L'\x2022',
-	L'\x25d8', L'\x25cb', L'\x25d9', L'\x2642',
-	L'\x2640', L'\x266a', L'\x266b', L'\x263c',
-
-	/* 1x */
-	L'\x25ba', L'\x25c4', L'\x2195', L'\x203c',
-	L'\x00b6', L'\x00a7', L'\x25ac', L'\x21a8',
-	L'\x2191', L'\x2193', L'\x2192', L'\x2190',
-	L'\x221f', L'\x2194', L'\x25b2', L'\x25bc',
-
-	/* 2x */
-	L'\x0020', L'\x0021', L'\x0022', L'\x0023',
-	L'\x0024', L'\x0025', L'\x0026', L'\x0027',
-	L'\x0028', L'\x0029', L'\x002a', L'\x002b',
-	L'\x002c', L'\x002d', L'\x002e', L'\x002f',
-
-	/* 3x */
-	L'\x0030', L'\x0031', L'\x0032', L'\x0033',
-	L'\x0034', L'\x0035', L'\x0036', L'\x0037',
-	L'\x0038', L'\x0039', L'\x003a', L'\x003b',
-	L'\x003c', L'\x003d', L'\x003e', L'\x003f',
-
-	/* 4x */
-	L'\x0040', L'\x0041', L'\x0042', L'\x0043',
-	L'\x0044', L'\x0045', L'\x0046', L'\x0047',
-	L'\x0048', L'\x0049', L'\x004a', L'\x004b',
-	L'\x004c', L'\x004d', L'\x004e', L'\x004f',
-
-	/* 5x */
-	L'\x0050', L'\x0051', L'\x0052', L'\x0053',
-	L'\x0054', L'\x0055', L'\x0056', L'\x0057',
-	L'\x0058', L'\x0059', L'\x005a', L'\x005b',
-	L'\x005c', L'\x005d', L'\x005e', L'\x005f',
-
-	/* 6x */
-	L'\x0060', L'\x0061', L'\x0062', L'\x0063',
-	L'\x0064', L'\x0065', L'\x0066', L'\x0067',
-	L'\x0068', L'\x0069', L'\x006a', L'\x006b',
-	L'\x006c', L'\x006d', L'\x006e', L'\x006f',
-
-	/* 7x */
-	L'\x0070', L'\x0071', L'\x0072', L'\x0073',
-	L'\x0074', L'\x0075', L'\x0076', L'\x0077',
-	L'\x0078', L'\x0079', L'\x007a', L'\x007b',
-	L'\x007c', L'\x007d', L'\x007e', L'\x2302',
-
-	/* 8x */
-	L'\x00c7', L'\x00fc', L'\x00e9', L'\x00e2',
-	L'\x00e4', L'\x00e0', L'\x00e5', L'\x00e7',
-	L'\x00ea', L'\x00eb', L'\x00e8', L'\x00ef',
-	L'\x00ee', L'\x00ec', L'\x00c4', L'\x00c5',
-
-	/* 9x */
-	L'\x00c9', L'\x00e6', L'\x00c6', L'\x00f4',
-	L'\x00f6', L'\x00f2', L'\x00fb', L'\x00f9',
-	L'\x00ff', L'\x00d6', L'\x00dc', L'\x00a2',
-	L'\x00a3', L'\x00a5', L'\x20a7', L'\x0192',
-
-	/* Ax */
-	L'\x00e1', L'\x00ed', L'\x00f3', L'\x00fa',
-	L'\x00f1', L'\x00d1', L'\x00aa', L'\x00ba',
-	L'\x00bf', L'\x2310', L'\x00ac', L'\x00bd',
-	L'\x00bc', L'\x00a1', L'\x00ab', L'\x00bb',
-
-	/* Bx */
-	L'\x2591', L'\x2592', L'\x2593', L'\x2502',
-	L'\x2524', L'\x2561', L'\x2562', L'\x2556',
-	L'\x2555', L'\x2563', L'\x2551', L'\x2557',
-	L'\x255d', L'\x255c', L'\x255b', L'\x2510',
-
-	/* Cx */
-	L'\x2514', L'\x2534', L'\x252c', L'\x251c',
-	L'\x2500', L'\x253c', L'\x255e', L'\x255f',
-	L'\x255a', L'\x2554', L'\x2569', L'\x2566',
-	L'\x2560', L'\x2550', L'\x256c', L'\x2567',
-
-	/* Dx */
-	L'\x2568', L'\x2564', L'\x2565', L'\x2559',
-	L'\x2558', L'\x2552', L'\x2553', L'\x256b',
-	L'\x256a', L'\x2518', L'\x250c', L'\x2588',
-	L'\x2584', L'\x258c', L'\x2590', L'\x2580',
-
-	/* Ex */
-	L'\x03b1', L'\x00df', L'\x0393', L'\x03c0',
-	L'\x03a3', L'\x03c3', L'\x00b5', L'\x03c4',
-	L'\x03a6', L'\x0398', L'\x03a9', L'\x03b4',
-	L'\x221e', L'\x03c6', L'\x03b5', L'\x2229',
-
-	/* Fx */
-	L'\x2261', L'\x00b1', L'\x2265', L'\x2264',
-	L'\x2320', L'\x2321', L'\x00f7', L'\x2248',
-	L'\x00b0', L'\x2219', L'\x00b7', L'\x221a',
-	L'\x207f', L'\x00b2', L'\x25a0', L'\x00a0'
-};
-
-/** Map of Unicode characters 0x0000 - 0x0400 to code page 437 */
-static uint8_t u0xxx_to_cp437[0x400] = {
-	/* 0x */
-	[0x0000] = 0x00,
-
-	/* 1x */
-	[0x00b6] = 0x14, [0x00a7] = 0x15,
-
-	/* 2x */
-	[0x0020] = 0x20, [0x0021] = 0x21, [0x0022] = 0x22, [0x0023] = 0x23,
-	[0x0024] = 0x24, [0x0025] = 0x25, [0x0026] = 0x26, [0x0027] = 0x27,
-	[0x0028] = 0x28, [0x0029] = 0x29, [0x002a] = 0x2a, [0x002b] = 0x2b,
-	[0x002c] = 0x2c, [0x002d] = 0x2d, [0x002e] = 0x2e, [0x002f] = 0x2f,
-
-	/* 3x */
-	[0x0030] = 0x30, [0x0031] = 0x31, [0x0032] = 0x32, [0x0033] = 0x33,
-	[0x0034] = 0x34, [0x0035] = 0x35, [0x0036] = 0x36, [0x0037] = 0x37,
-	[0x0038] = 0x38, [0x0039] = 0x39, [0x003a] = 0x3a, [0x003b] = 0x3b,
-	[0x003c] = 0x3c, [0x003d] = 0x3d, [0x003e] = 0x3e, [0x003f] = 0x3f,
-
-	/* 4x */
-	[0x0040] = 0x40, [0x0041] = 0x41, [0x0042] = 0x42, [0x0043] = 0x43,
-	[0x0044] = 0x44, [0x0045] = 0x45, [0x0046] = 0x46, [0x0047] = 0x47,
-	[0x0048] = 0x48, [0x0049] = 0x49, [0x004a] = 0x4a, [0x004b] = 0x4b,
-	[0x004c] = 0x4c, [0x004d] = 0x4d, [0x004e] = 0x4e, [0x004f] = 0x4f,
-
-	/* 5x */
-	[0x0050] = 0x50, [0x0051] = 0x51, [0x0052] = 0x52, [0x0053] = 0x53,
-	[0x0054] = 0x54, [0x0055] = 0x55, [0x0056] = 0x56, [0x0057] = 0x57,
-	[0x0058] = 0x58, [0x0059] = 0x59, [0x005a] = 0x5a, [0x005b] = 0x5b,
-	[0x005c] = 0x5c, [0x005d] = 0x5d, [0x005e] = 0x5e, [0x005f] = 0x5f,
-
-	/* 6x */
-	[0x0060] = 0x60, [0x0061] = 0x61, [0x0062] = 0x62, [0x0063] = 0x63,
-	[0x0064] = 0x64, [0x0065] = 0x65, [0x0066] = 0x66, [0x0067] = 0x67,
-	[0x0068] = 0x68, [0x0069] = 0x69, [0x006a] = 0x6a, [0x006b] = 0x6b,
-	[0x006c] = 0x6c, [0x006d] = 0x6d, [0x006e] = 0x6e, [0x006f] = 0x6f,
-
-	/* 7x */
-	[0x0070] = 0x70, [0x0071] = 0x71, [0x0072] = 0x72, [0x0073] = 0x73,
-	[0x0074] = 0x74, [0x0075] = 0x75, [0x0076] = 0x76, [0x0077] = 0x77,
-	[0x0078] = 0x78, [0x0079] = 0x79, [0x007a] = 0x7a, [0x007b] = 0x7b,
-	[0x007c] = 0x7c, [0x007d] = 0x7d, [0x007e] = 0x7e,
-
-	/* 8x */
-	[0x00c7] = 0x80, [0x00fc] = 0x81, [0x00e9] = 0x82, [0x00e2] = 0x83,
-	[0x00e4] = 0x84, [0x00e0] = 0x85, [0x00e5] = 0x86, [0x00e7] = 0x87,
-	[0x00ea] = 0x88, [0x00eb] = 0x89, [0x00e8] = 0x8a, [0x00ef] = 0x8b,
-	[0x00ee] = 0x8c, [0x00ec] = 0x8d, [0x00c4] = 0x8e, [0x00c5] = 0x8f,
-
-	/* 9x */
-	[0x00c9] = 0x90, [0x00e6] = 0x91, [0x00c6] = 0x92, [0x00f4] = 0x93,
-	[0x00f6] = 0x94, [0x00f2] = 0x95, [0x00fb] = 0x96, [0x00f9] = 0x97,
-	[0x00ff] = 0x98, [0x00d6] = 0x99, [0x00dc] = 0x9a, [0x00a2] = 0x9b,
-	[0x00a3] = 0x9c, [0x00a5] = 0x9d,                  [0x0192] = 0x9f,
-
-	/* Ax */
-	[0x00e1] = 0xa0, [0x00ed] = 0xa1, [0x00f3] = 0xa2, [0x00fa] = 0xa3,
-	[0x00f1] = 0xa4, [0x00d1] = 0xa5, [0x00aa] = 0xa6, [0x00ba] = 0xa7,
-	[0x00bf] = 0xa8,                  [0x00ac] = 0xaa, [0x00bd] = 0xab,
-	[0x00bc] = 0xac, [0x00a1] = 0xad, [0x00ab] = 0xae, [0x00bb] = 0xaf,
-
-	/* Ex */
-	[0x03b1] = 0xe0, [0x00df] = 0xe1, [0x0393] = 0xe2, [0x03c0] = 0xe3,
-	[0x03a3] = 0xe4, [0x03c3] = 0xe5, [0x00b5] = 0xe6, [0x03c4] = 0xe7,
-	[0x03a6] = 0xe8, [0x0398] = 0xe9, [0x03a9] = 0xea, [0x03b4] = 0xeb,
-	/* skipped */    [0x03c6] = 0xed, [0x03b5] = 0xee,
-
-	/* Fx */
-	/* skipped */    [0x00b1] = 0xf1,
-	/* skipped */                     [0x00f7] = 0xf6,
-	[0x00b0] = 0xf8, [0x00b7] = 0xfa,
-	/* skipped */    [0x00b2] = 0xfd,                  [0x00a0] = 0xff,
-};
-
-/** Map of Unicode characters 0x2000 - 0x2700 to code page 437 */
-static uint8_t u2xxx_to_cp437[0x700] = {
-	/* 0x */
-	/* skipped */   [0x63a] = 0x01, [0x63b] = 0x02, [0x665] = 0x03,
-	[0x666] = 0x04, [0x663] = 0x05, [0x660] = 0x06, [0x022] = 0x07,
-	[0x5d8] = 0x08, [0x5cb] = 0x09, [0x5d9] = 0x0a, [0x642] = 0x0b,
-	[0x640] = 0x0c, [0x66a] = 0x0d, [0x66b] = 0x0e, [0x63c] = 0x0f,
-
-	/* 1x */
-	[0x5ba] = 0x10, [0x5c4] = 0x11, [0x195] = 0x12, [0x03c] = 0x13,
-	/* skipped */                   [0x5ac] = 0x16, [0x1a8] = 0x17,
-	[0x191] = 0x18, [0x193] = 0x19, [0x192] = 0x1a, [0x190] = 0x1b,
-	[0x21f] = 0x1c, [0x194] = 0x1d, [0x5b2] = 0x1e, [0x5bc] = 0x1f,
-
-	/* 7x */
-	[0x302] = 0x7f,
-
-	/* 9x */
-	[0x0a7] = 0x9e,
-
-	/* Ax */
-	[0x310] = 0xa9,
-
-	/* Bx */
-	[0x591] = 0xb0, [0x592] = 0xb1, [0x593] = 0xb2, [0x502] = 0xb3,
-	[0x524] = 0xb4, [0x561] = 0xb5, [0x562] = 0xb6, [0x556] = 0xb7,
-	[0x555] = 0xb8, [0x563] = 0xb9, [0x551] = 0xba, [0x557] = 0xbb,
-	[0x55d] = 0xbc, [0x55c] = 0xbd, [0x55b] = 0xbe, [0x510] = 0xbf,
-
-	/* Cx */
-	[0x514] = 0xc0, [0x534] = 0xc1, [0x52c] = 0xc2, [0x51c] = 0xc3,
-	[0x500] = 0xc4, [0x53c] = 0xc5, [0x55e] = 0xc6, [0x55f] = 0xc7,
-	[0x55a] = 0xc8, [0x554] = 0xc9, [0x569] = 0xca, [0x566] = 0xcb,
-	[0x560] = 0xcc, [0x550] = 0xcd, [0x56c] = 0xce, [0x567] = 0xcf,
-
-	/* Dx */
-	[0x568] = 0xd0, [0x564] = 0xd1, [0x565] = 0xd2, [0x559] = 0xd3,
-	[0x558] = 0xd4, [0x552] = 0xd5, [0x553] = 0xd6, [0x56b] = 0xd7,
-	[0x56a] = 0xd8, [0x518] = 0xd9, [0x50c] = 0xda, [0x588] = 0xdb,
-	[0x584] = 0xdc, [0x58c] = 0xdd, [0x590] = 0xde, [0x580] = 0xdf,
-
-	/* Ex */
-	[0x21e] = 0xec, [0x229] = 0xef,
-
-	/* Fx */
-	[0x261] = 0xf0,                 [0x265] = 0xf2, [0x264] = 0xf3,
-	[0x320] = 0xf4, [0x321] = 0xf5,                 [0x248] = 0xf7,
-	/* skipped */   [0x219] = 0xf9,                 [0x21a] = 0xfb,
-	[0x07f] = 0xfc,                 [0x5a0] = 0xfe
-};
-
-/** Decode character from code page 437 8-bit code.
- *
- * Note that this function considers all code page 437 members as graphic
- * characters (including those in range 0-31), not control characters.
- *
- * @param code 8-bit code
- * @return Character
- */
-char32_t cp437_decode(uint8_t code)
-{
-	return cp437[code];
-}
-
-/** Encode character to code page 437 8-bit code.
- *
- * Note that this function considers all code page 437 members as graphic
- * characters (including those in range 0-31), not control characters.
- *
- * @param c Character
- * @param code Place to store 8-bit code
- * @return EOK on success, EDOM if character cannot be encoded to CP437.
- */
-errno_t cp437_encode(char32_t c, uint8_t *code)
-{
-	uint8_t b;
-
-	/* Unicode character 0 is the only that can map to cp437 code 0 */
-	if (c == 0) {
-		*code = 0;
-		return EOK;
-	}
-
-	b = 0;
-
-	/*
-	 * The map is split into two parts, 0x0000 - 0x0400 and
-	 * 0x2000 - 0x2700. This seems like a reasonable compromise
-	 * between complexity and memory efficiency.
-	 */
-
-	if (c < 0x400)
-		b = u0xxx_to_cp437[c];
-	else if (c >= 0x2000 && c < 0x2700)
-		b = u2xxx_to_cp437[c - 0x2000];
-
-	/*
-	 * If we got zero, it was an uninitialized entry (since no Unicode
-	 * character except 0 can map to b == 0 and that was already
-	 * taken care of).
-	 */
-	if (b == 0)
-		return EDOM;
-
-	*code = b;
-	return EOK;
-}
-
-/** @}
- */
Index: pace/lib/codepage/test/cp437.c
===================================================================
--- uspace/lib/codepage/test/cp437.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <codepage/cp437.h>
-#include <pcut/pcut.h>
-
-PCUT_INIT;
-
-PCUT_TEST_SUITE(cp437);
-
-/** Encode(decode) == identity */
-PCUT_TEST(decode_encode)
-{
-	unsigned code;
-	char32_t c;
-	uint8_t cdec;
-	errno_t rc;
-
-	for (code = 0; code < 256; code++) {
-		c = cp437_decode(code);
-		rc = cp437_encode(c, &cdec);
-		PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-		PCUT_ASSERT_EQUALS(code, cdec);
-	}
-}
-
-/** Test limit encoding cases */
-PCUT_TEST(encode_cases)
-{
-	uint8_t code;
-	errno_t rc;
-
-	/* Zero maps to zero */
-	rc = cp437_encode(0, &code);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_EQUALS(0x00, code);
-
-	/* Last entry in the 0x0000-0x03ff table is unmapped */
-	rc = cp437_encode(0x3ff, &code);
-	PCUT_ASSERT_ERRNO_VAL(EDOM, rc);
-
-	/* 0x0400 is out of range of first table */
-	rc = cp437_encode(0x400, &code);
-	PCUT_ASSERT_ERRNO_VAL(EDOM, rc);
-
-	/* 0x1fff is before start of 0x2000-0x26ff table */
-	rc = cp437_encode(0x1fff, &code);
-	PCUT_ASSERT_ERRNO_VAL(EDOM, rc);
-
-	/* First entry in 0x2000-0x26ff table is unmapped */
-	rc = cp437_encode(0x2000, &code);
-	PCUT_ASSERT_ERRNO_VAL(EDOM, rc);
-
-	/* Last entry in 0x2000-0x26ff table is unmapped */
-	rc = cp437_encode(0x26ff, &code);
-	PCUT_ASSERT_ERRNO_VAL(EDOM, rc);
-
-	/* 0x2700 is beyond the end of 0x2000-0x26ff table */
-	rc = cp437_encode(0x2700, &code);
-	PCUT_ASSERT_ERRNO_VAL(EDOM, rc);
-}
-
-PCUT_EXPORT(cp437);
Index: pace/lib/codepage/test/main.c
===================================================================
--- uspace/lib/codepage/test/main.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,35 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <pcut/pcut.h>
-
-PCUT_INIT;
-
-PCUT_IMPORT(cp437);
-
-PCUT_MAIN();
Index: uspace/lib/congfx/src/console.c
===================================================================
--- uspace/lib/congfx/src/console.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/congfx/src/console.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -57,7 +57,4 @@
 static errno_t console_gc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
 static errno_t console_gc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
-static errno_t console_gc_cursor_get_pos(void *, gfx_coord2_t *);
-static errno_t console_gc_cursor_set_pos(void *, gfx_coord2_t *);
-static errno_t console_gc_cursor_set_visible(void *, bool);
 
 gfx_context_ops_t console_gc_ops = {
@@ -69,46 +66,6 @@
 	.bitmap_destroy = console_gc_bitmap_destroy,
 	.bitmap_render = console_gc_bitmap_render,
-	.bitmap_get_alloc = console_gc_bitmap_get_alloc,
-	.cursor_get_pos = console_gc_cursor_get_pos,
-	.cursor_set_pos = console_gc_cursor_set_pos,
-	.cursor_set_visible = console_gc_cursor_set_visible
+	.bitmap_get_alloc = console_gc_bitmap_get_alloc
 };
-
-/** Convert pixel value to charfield.
- *
- * On the bottom of this function lies a big big hack. In the absence
- * of support for different color formats (FIX ME!), here's a single
- * format that can represent both 3x8bit RGB and 24-bit characters
- * with 8-bit EGA attributes (i.e. we can specify the foreground and
- * background colors individually).
- *
- * A    R   G   B
- * 0    red grn blu  24-bit color
- * attr c2  c1  c0   attribute + 24-bit character
- */
-static void console_gc_pix_to_charfield(pixel_t clr, charfield_t *ch)
-{
-	uint8_t attr;
-
-	if ((clr >> 24) == 0) {
-		/* RGB (no text) */
-		ch->ch = 0;
-		ch->flags = CHAR_FLAG_DIRTY;
-		ch->attrs.type = CHAR_ATTR_RGB;
-		ch->attrs.val.rgb.fgcolor = clr ^ 0xffffff;
-		ch->attrs.val.rgb.bgcolor = clr;
-	} else {
-		/* EGA attributes (with text) */
-		attr = clr >> 24;
-		ch->ch = clr & 0xffffff;
-		ch->flags = CHAR_FLAG_DIRTY;
-		ch->attrs.type = CHAR_ATTR_INDEX;
-		ch->attrs.val.index.fgcolor = attr & 0x7;
-		ch->attrs.val.index.bgcolor = (attr >> 4) & 0x7;
-		ch->attrs.val.index.attr =
-		    ((attr & 0x8) ? CATTR_BRIGHT : 0) +
-		    ((attr & 0x80) ? CATTR_BLINK : 0);
-	}
-}
 
 /** Set clipping rectangle on console GC.
@@ -144,5 +101,5 @@
 	console_gc_t *cgc = (console_gc_t *) arg;
 
-	cgc->clr = PIXEL(color->attr, color->r >> 8, color->g >> 8, color->b >> 8);
+	cgc->clr = PIXEL(0, color->r >> 8, color->g >> 8, color->b >> 8);
 	return EOK;
 }
@@ -168,5 +125,9 @@
 	cols = cgc->rect.p1.x - cgc->rect.p0.x;
 
-	console_gc_pix_to_charfield(cgc->clr, &ch);
+	ch.ch = cgc->clr >> 24;
+	ch.flags = CHAR_FLAG_DIRTY;
+	ch.attrs.type = CHAR_ATTR_RGB;
+	ch.attrs.val.rgb.fgcolor = cgc->clr ^ 0xffffff;
+	ch.attrs.val.rgb.bgcolor = cgc->clr;
 
 	for (y = crect.p0.y; y < crect.p1.y; y++) {
@@ -407,5 +368,10 @@
 				    y - offs.y - cbm->rect.p0.y);
 
-				console_gc_pix_to_charfield(clr, &ch);
+				ch.ch = clr >> 24;
+				ch.flags = CHAR_FLAG_DIRTY;
+				ch.attrs.type = CHAR_ATTR_RGB;
+				ch.attrs.val.rgb.fgcolor = clr ^ 0xffffff;
+				ch.attrs.val.rgb.bgcolor = clr;
+
 				cbm->cgc->buf[y * cols + x] = ch;
 			}
@@ -420,5 +386,9 @@
 				    y - offs.y - cbm->rect.p0.y);
 
-				console_gc_pix_to_charfield(clr, &ch);
+				ch.ch = clr >> 24;
+				ch.flags = CHAR_FLAG_DIRTY;
+				ch.attrs.type = CHAR_ATTR_RGB;
+				ch.attrs.val.rgb.fgcolor = clr ^ 0xffffff;
+				ch.attrs.val.rgb.bgcolor = clr;
 
 				if (clr != cbm->key_color)
@@ -428,5 +398,9 @@
 	} else {
 		/* Color key & colorize */
-		console_gc_pix_to_charfield(cbm->cgc->clr, &ch);
+		ch.ch = 0;
+		ch.flags = CHAR_FLAG_DIRTY;
+		ch.attrs.type = CHAR_ATTR_RGB;
+		ch.attrs.val.rgb.fgcolor = cbm->cgc->clr;
+		ch.attrs.val.rgb.bgcolor = cbm->cgc->clr;
 
 		for (y = crect.p0.y; y < crect.p1.y; y++) {
@@ -461,57 +435,4 @@
 }
 
-/** Get cursor position on console GC.
- *
- * @param arg Console GC
- * @param pos Place to store position
- *
- * @return EOK on success or an error code
- */
-static errno_t console_gc_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	console_gc_t *cgc = (console_gc_t *) arg;
-	sysarg_t col;
-	sysarg_t row;
-	errno_t rc;
-
-	rc = console_get_pos(cgc->con, &col, &row);
-	if (rc != EOK)
-		return rc;
-
-	pos->x = col;
-	pos->y = row;
-	return EOK;
-}
-
-/** Set cursor position on console GC.
- *
- * @param arg Console GC
- * @param pos New cursor position
- *
- * @return EOK on success or an error code
- */
-static errno_t console_gc_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	console_gc_t *cgc = (console_gc_t *) arg;
-
-	console_set_pos(cgc->con, pos->x, pos->y);
-	return EOK;
-}
-
-/** Set cursor visibility on console GC.
- *
- * @param arg Console GC
- * @param visible @c true iff cursor should be made visible
- *
- * @return EOK on success or an error code
- */
-static errno_t console_gc_cursor_set_visible(void *arg, bool visible)
-{
-	console_gc_t *cgc = (console_gc_t *) arg;
-
-	console_cursor_visibility(cgc->con, visible);
-	return EOK;
-}
-
 /** @}
  */
Index: uspace/lib/ddev/include/ipc/ddev.h
===================================================================
--- uspace/lib/ddev/include/ipc/ddev.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ddev/include/ipc/ddev.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDDEV_IPC_DDEV_H
-#define LIBDDEV_IPC_DDEV_H
+#ifndef _LIBC_IPC_DDEV_H_
+#define _LIBC_IPC_DDEV_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/bd.h
===================================================================
--- uspace/lib/device/include/bd.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/bd.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_BD_H
-#define LIBDEVICE_BD_H
+#ifndef _LIBC_BD_H_
+#define _LIBC_BD_H_
 
 #include <async.h>
Index: uspace/lib/device/include/bd_srv.h
===================================================================
--- uspace/lib/device/include/bd_srv.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/bd_srv.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_BD_SRV_H
-#define LIBDEVICE_BD_SRV_H
+#ifndef _LIBC_BD_SRV_H_
+#define _LIBC_BD_SRV_H_
 
 #include <adt/list.h>
Index: uspace/lib/device/include/device/led_dev.h
===================================================================
--- uspace/lib/device/include/device/led_dev.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/device/led_dev.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_DEVICE_LED_DEV_H
-#define LIBDEVICE_DEVICE_LED_DEV_H
+#ifndef _LIBC_DEVICE_LED_DEV_H_
+#define _LIBC_DEVICE_LED_DEV_H_
 
 #include <async.h>
Index: uspace/lib/device/include/devman.h
===================================================================
--- uspace/lib/device/include/devman.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/devman.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -28,5 +28,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -34,6 +34,6 @@
  */
 
-#ifndef LIBDEVICE_DEVMAN_H
-#define LIBDEVICE_DEVMAN_H
+#ifndef _LIBC_DEVMAN_H_
+#define _LIBC_DEVMAN_H_
 
 #include <ipc/devman.h>
Index: uspace/lib/device/include/ieee80211/ieee80211.h
===================================================================
--- uspace/lib/device/include/ieee80211/ieee80211.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ieee80211/ieee80211.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  *  @{
  */
@@ -35,6 +35,6 @@
  */
 
-#ifndef LIBDEVICE_IEEE80211_H
-#define LIBDEVICE_IEEE80211_H
+#ifndef _LIBC_IEEE80211_H_
+#define _LIBC_IEEE80211_H_
 
 #include <adt/list.h>
Index: uspace/lib/device/include/io/chardev.h
===================================================================
--- uspace/lib/device/include/io/chardev.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/io/chardev.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,10 +27,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
 
-#ifndef LIBDEVICE_IO_CHARDEV_H
-#define LIBDEVICE_IO_CHARDEV_H
+#ifndef _LIBC_IO_CHARDEV_H_
+#define _LIBC_IO_CHARDEV_H_
 
 #include <async.h>
Index: uspace/lib/device/include/io/chardev_srv.h
===================================================================
--- uspace/lib/device/include/io/chardev_srv.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/io/chardev_srv.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_IO_CHARDEV_SRV_H
-#define LIBDEVICE_IO_CHARDEV_SRV_H
+#ifndef _LIBC_IO_CHARDEV_SRV_H_
+#define _LIBC_IO_CHARDEV_SRV_H_
 
 #include <adt/list.h>
Index: uspace/lib/device/include/io/label.h
===================================================================
--- uspace/lib/device/include/io/label.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/io/label.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_IO_LABEL_H
-#define LIBDEVICE_IO_LABEL_H
+#ifndef _LIBC_IO_LABEL_H_
+#define _LIBC_IO_LABEL_H_
 
 #include <types/label.h>
Index: uspace/lib/device/include/io/serial.h
===================================================================
--- uspace/lib/device/include/io/serial.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/io/serial.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_IO_SERIAL_H
-#define LIBDEVICE_IO_SERIAL_H
+#ifndef _LIBC_IO_SERIAL_H_
+#define _LIBC_IO_SERIAL_H_
 
 #include <async.h>
Index: uspace/lib/device/include/ipc/adb.h
===================================================================
--- uspace/lib/device/include/ipc/adb.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/adb.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libcipc
  * @{
  */
@@ -34,6 +34,6 @@
  */
 
-#ifndef LIBDEVICE_IPC_ADB_H
-#define LIBDEVICE_IPC_ADB_H
+#ifndef _LIBC_IPC_ADB_H_
+#define _LIBC_IPC_ADB_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/ipc/bd.h
===================================================================
--- uspace/lib/device/include/ipc/bd.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/bd.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_IPC_BD_H
-#define LIBDEVICE_IPC_BD_H
+#ifndef _LIBC_IPC_BD_H_
+#define _LIBC_IPC_BD_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/ipc/chardev.h
===================================================================
--- uspace/lib/device/include/ipc/chardev.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/chardev.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libcipc
  * @{
  */
@@ -34,6 +34,6 @@
  */
 
-#ifndef LIBDEVICE_IPC_CHARDEV_H
-#define LIBDEVICE_IPC_CHARDEV_H
+#ifndef _LIBC_IPC_CHARDEV_H_
+#define _LIBC_IPC_CHARDEV_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/ipc/devman.h
===================================================================
--- uspace/lib/device/include/ipc/devman.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/devman.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -31,6 +31,6 @@
  */
 
-#ifndef LIBDEVICE_IPC_DEVMAN_H
-#define LIBDEVICE_IPC_DEVMAN_H
+#ifndef _LIBC_IPC_DEVMAN_H_
+#define _LIBC_IPC_DEVMAN_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/ipc/irc.h
===================================================================
--- uspace/lib/device/include/ipc/irc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/irc.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_IPC_IRC_H
-#define LIBDEVICE_IPC_IRC_H
+#ifndef _LIBC_IPC_IRC_H_
+#define _LIBC_IPC_IRC_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/ipc/pci.h
===================================================================
--- uspace/lib/device/include/ipc/pci.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/pci.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_IPC_PCI_H
-#define LIBDEVICE_IPC_PCI_H
+#ifndef _LIBC_IPC_PCI_H_
+#define _LIBC_IPC_PCI_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/ipc/serial_ctl.h
===================================================================
--- uspace/lib/device/include/ipc/serial_ctl.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/serial_ctl.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,6 +27,6 @@
  */
 
-#ifndef LIBDEVICE_IPC_SERIAL_CTL_H
-#define LIBDEVICE_IPC_SERIAL_CTL_H
+#ifndef _LIBC_IPC_SERIAL_CTL_H_
+#define _LIBC_IPC_SERIAL_CTL_H_
 
 #include <ipc/chardev.h>
Index: uspace/lib/device/include/ipc/vbd.h
===================================================================
--- uspace/lib/device/include/ipc/vbd.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/vbd.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,10 +27,10 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libcipc
  * @{
  */
 
-#ifndef LIBDEVICE_IPC_VBD_H
-#define LIBDEVICE_IPC_VBD_H
+#ifndef _LIBC_IPC_VBD_H_
+#define _LIBC_IPC_VBD_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/ipc/vol.h
===================================================================
--- uspace/lib/device/include/ipc/vol.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/ipc/vol.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,10 +27,10 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libcipc
  * @{
  */
 
-#ifndef LIBDEVICE_IPC_VOL_H
-#define LIBDEVICE_IPC_VOL_H
+#ifndef _LIBC_IPC_VOL_H_
+#define _LIBC_IPC_VOL_H_
 
 #include <ipc/common.h>
Index: uspace/lib/device/include/irc.h
===================================================================
--- uspace/lib/device/include/irc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/irc.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_IRC_H
-#define LIBDEVICE_IRC_H
+#ifndef _LIBC_IRC_H_
+#define _LIBC_IRC_H_
 
 extern errno_t irc_enable_interrupt(int);
Index: uspace/lib/device/include/nic/eth_phys.h
===================================================================
--- uspace/lib/device/include/nic/eth_phys.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/nic/eth_phys.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -28,6 +28,6 @@
  */
 
-#ifndef LIBDEVICE_NIC_ETH_PHYS_H
-#define LIBDEVICE_NIC_ETH_PHYS_H
+#ifndef _LIBC_NIC_ETH_PHYS_H_
+#define _LIBC_NIC_ETH_PHYS_H_
 
 #include <stdint.h>
Index: uspace/lib/device/include/nic/nic.h
===================================================================
--- uspace/lib/device/include/nic/nic.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/nic/nic.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -28,5 +28,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -36,6 +36,6 @@
  */
 
-#ifndef LIBDEVICE_NIC_H
-#define LIBDEVICE_NIC_H
+#ifndef _LIBC_NIC_H_
+#define _LIBC_NIC_H_
 
 #include <nic/eth_phys.h>
@@ -269,5 +269,5 @@
 	/** The mask of all modes which the device can advertise
 	 *
-	 *  see ETH_AUTONEG_ macros in nic/eth_phys.h of libdevice
+	 *  see ETH_AUTONEG_ macros in nic/eth_phys.h of libc
 	 */
 	uint32_t autoneg_support;
Index: uspace/lib/device/include/pci.h
===================================================================
--- uspace/lib/device/include/pci.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/pci.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_PCI_H
-#define LIBDEVICE_PCI_H
+#ifndef _LIBC_PCI_H_
+#define _LIBC_PCI_H_
 
 #include <errno.h>
Index: uspace/lib/device/include/types/io/chardev.h
===================================================================
--- uspace/lib/device/include/types/io/chardev.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/types/io/chardev.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -26,10 +26,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
 
-#ifndef LIBDEVICE_TYPES_IO_CHARDEV_H
-#define LIBDEVICE_TYPES_IO_CHARDEV_H
+#ifndef _LIBC_TYPES_IO_CHARDEV_H_
+#define _LIBC_TYPES_IO_CHARDEV_H_
 
 /** Chardev read/write operation flags */
Index: uspace/lib/device/include/types/label.h
===================================================================
--- uspace/lib/device/include/types/label.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/types/label.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_TYPES_LABEL_H
-#define LIBDEVICE_TYPES_LABEL_H
+#ifndef _LIBC_TYPES_LABEL_H_
+#define _LIBC_TYPES_LABEL_H_
 
 #include <types/uuid.h>
Index: uspace/lib/device/include/types/pci.h
===================================================================
--- uspace/lib/device/include/types/pci.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/types/pci.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_TYPES_PCI_H
-#define LIBDEVICE_TYPES_PCI_H
+#ifndef _LIBC_TYPES_PCI_H_
+#define _LIBC_TYPES_PCI_H_
 
 #include <async.h>
Index: uspace/lib/device/include/types/vol.h
===================================================================
--- uspace/lib/device/include/types/vol.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/types/vol.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_TYPES_VOL_H
-#define LIBDEVICE_TYPES_VOL_H
+#ifndef _LIBC_TYPES_VOL_H_
+#define _LIBC_TYPES_VOL_H_
 
 #include <async.h>
Index: uspace/lib/device/include/vbd.h
===================================================================
--- uspace/lib/device/include/vbd.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/vbd.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_VBD_H
-#define LIBDEVICE_VBD_H
+#ifndef _LIBC_VBD_H_
+#define _LIBC_VBD_H_
 
 #include <async.h>
Index: uspace/lib/device/include/vol.h
===================================================================
--- uspace/lib/device/include/vol.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/include/vol.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDEVICE_VOL_H
-#define LIBDEVICE_VOL_H
+#ifndef _LIBC_VOL_H_
+#define _LIBC_VOL_H_
 
 #include <async.h>
Index: uspace/lib/device/src/bd.c
===================================================================
--- uspace/lib/device/src/bd.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/bd.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/bd_srv.c
===================================================================
--- uspace/lib/device/src/bd_srv.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/bd_srv.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/device/led_dev.c
===================================================================
--- uspace/lib/device/src/device/led_dev.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/device/led_dev.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/devman.c
===================================================================
--- uspace/lib/device/src/devman.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/devman.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -29,5 +29,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/io/chardev.c
===================================================================
--- uspace/lib/device/src/io/chardev.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/io/chardev.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -28,5 +28,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/io/chardev_srv.c
===================================================================
--- uspace/lib/device/src/io/chardev_srv.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/io/chardev_srv.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/io/label.c
===================================================================
--- uspace/lib/device/src/io/label.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/io/label.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/irc.c
===================================================================
--- uspace/lib/device/src/irc.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/irc.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/pci.c
===================================================================
--- uspace/lib/device/src/pci.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/pci.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/vbd.c
===================================================================
--- uspace/lib/device/src/vbd.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/vbd.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/device/src/vol.c
===================================================================
--- uspace/lib/device/src/vol.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/device/src/vol.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdevice
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/display/include/ipc/display.h
===================================================================
--- uspace/lib/display/include/ipc/display.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/display/include/ipc/display.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBDISPLAY_IPC_DISPLAY_H
-#define LIBDISPLAY_IPC_DISPLAY_H
+#ifndef _LIBC_IPC_DISPLAY_H_
+#define _LIBC_IPC_DISPLAY_H_
 
 #include <ipc/common.h>
Index: uspace/lib/drv/generic/remote_ieee80211.c
===================================================================
--- uspace/lib/drv/generic/remote_ieee80211.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/drv/generic/remote_ieee80211.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2015 Jan Kolarik
  * All rights reserved.
@@ -85,13 +84,19 @@
 }
 
-// XXX This is wrong. Wifi should not have anything to do with IP links
+static bool mac_matches(uint8_t *mac1, uint8_t *mac2)
+{
+	for (size_t i = 0; i < ETH_ADDR; i++) {
+		if (mac1[i] != mac2[i])
+			return false;
+	}
+
+	return true;
+}
+
 static sysarg_t get_link_id(uint8_t *mac)
 {
 	sysarg_t *link_list;
 	inet_link_info_t link_info;
-	eth_addr_t eth_addr;
 	size_t count;
-
-	eth_addr_decode(mac, &eth_addr);
 
 	errno_t rc = inetcfg_get_link_list(&link_list, &count);
@@ -104,5 +109,5 @@
 			return -1;
 
-		if (eth_addr_compare(&eth_addr, &link_info.mac_addr) == 0)
+		if (mac_matches(mac, link_info.mac_addr))
 			return link_list[i];
 	}
@@ -165,6 +170,4 @@
 		return rc;
 
-	// XXX This is wrong. Wifi should not initiate DHCP
-
 	/* Send DHCP discover. */
 	nic_address_t wifi_mac;
@@ -204,7 +207,4 @@
 	if (rc != EOK)
 		return rc;
-
-	eth_addr_t eth_addr;
-	eth_addr_decode(wifi_mac.address, &eth_addr);
 
 	inet_link_info_t link_info;
@@ -215,6 +215,4 @@
 	size_t count;
 
-	/// XXX This is wrong. Wifi should do nothing with DHCP
-
 	/* Remove previous DHCP address. */
 	rc = inetcfg_get_addr_list(&addr_list, &count);
@@ -231,5 +229,5 @@
 			return rc;
 
-		if (eth_addr_compare(&eth_addr, &link_info.mac_addr) == 0) {
+		if (mac_matches(wifi_mac.address, link_info.mac_addr)) {
 			if (str_test_prefix(addr_info.name, "dhcp")) {
 				rc = inetcfg_addr_delete(addr_list[i]);
Index: uspace/lib/drv/include/battery_iface.h
===================================================================
--- uspace/lib/drv/include/battery_iface.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/drv/include/battery_iface.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdrv
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/drv/include/ieee80211_iface.h
===================================================================
--- uspace/lib/drv/include/ieee80211_iface.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/drv/include/ieee80211_iface.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdrv
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/drv/include/nic_iface.h
===================================================================
--- uspace/lib/drv/include/nic_iface.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/drv/include/nic_iface.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libdrv
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/gfx/include/gfx/color.h
===================================================================
--- uspace/lib/gfx/include/gfx/color.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfx/include/gfx/color.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2019 Jiri Svoboda
  * All rights reserved.
  *
@@ -43,9 +43,7 @@
 extern errno_t gfx_color_new_rgb_i16(uint16_t, uint16_t,
     uint16_t, gfx_color_t **);
-extern errno_t gfx_color_new_ega(uint8_t, gfx_color_t **);
 extern void gfx_color_delete(gfx_color_t *);
 extern void gfx_color_get_rgb_i16(gfx_color_t *, uint16_t *, uint16_t *,
     uint16_t *);
-extern void gfx_color_get_ega(gfx_color_t *, uint8_t *);
 
 #endif
Index: pace/lib/gfx/include/gfx/cursor.h
===================================================================
--- uspace/lib/gfx/include/gfx/cursor.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libgfx
- * @{
- */
-/**
- * @file Hardware cursor control
- */
-
-#ifndef _GFX_CURSOR_H
-#define _GFX_CURSOR_H
-
-#include <errno.h>
-#include <types/gfx/coord.h>
-#include <types/gfx/context.h>
-#include <stdbool.h>
-
-extern errno_t gfx_cursor_get_pos(gfx_context_t *, gfx_coord2_t *);
-extern errno_t gfx_cursor_set_pos(gfx_context_t *, gfx_coord2_t *);
-extern errno_t gfx_cursor_set_visible(gfx_context_t *, bool);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/gfx/include/types/gfx/ops/context.h
===================================================================
--- uspace/lib/gfx/include/types/gfx/ops/context.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfx/include/types/gfx/ops/context.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -44,5 +44,4 @@
 #include <types/gfx/coord.h>
 #include <types/gfx/context.h>
-#include <stdbool.h>
 
 /** Graphics context ops */
@@ -65,10 +64,4 @@
 	/** Get bitmap allocation info */
 	errno_t (*bitmap_get_alloc)(void *, gfx_bitmap_alloc_t *);
-	/** Get hardware cursor position */
-	errno_t (*cursor_get_pos)(void *, gfx_coord2_t *);
-	/** Set hardware cursor position */
-	errno_t (*cursor_set_pos)(void *, gfx_coord2_t *);
-	/** Set hardware cursor visibility */
-	errno_t (*cursor_set_visible)(void *, bool);
 } gfx_context_ops_t;
 
Index: uspace/lib/gfx/meson.build
===================================================================
--- uspace/lib/gfx/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfx/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 #
-# Copyright (c) 2021 Jiri Svoboda
+# Copyright (c) 2019 Jiri Svoboda
 # All rights reserved.
 #
@@ -32,5 +32,4 @@
 	'src/coord.c',
 	'src/context.c',
-	'src/cursor.c',
 	'src/render.c'
 )
@@ -40,5 +39,4 @@
 	'test/color.c',
 	'test/coord.c',
-	'test/cursor.c',
 	'test/main.c',
 	'test/render.c',
Index: uspace/lib/gfx/private/color.h
===================================================================
--- uspace/lib/gfx/private/color.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfx/private/color.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2019 Jiri Svoboda
  * All rights reserved.
  *
@@ -48,5 +48,4 @@
 	uint16_t g;
 	uint16_t b;
-	uint8_t attr;
 };
 
Index: uspace/lib/gfx/src/color.c
===================================================================
--- uspace/lib/gfx/src/color.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfx/src/color.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2019 Jiri Svoboda
  * All rights reserved.
  *
@@ -69,26 +69,4 @@
 }
 
-/** Create new EGA color.
- *
- * @param attr EGA attributes
- * @param rcolor Place to store pointer to new color
- *
- * @return EOK on success or an error code, ENOMEM if out of resources,
- *         EIO if the graphic device connection was lost
- */
-errno_t gfx_color_new_ega(uint8_t attr, gfx_color_t **rcolor)
-{
-	gfx_color_t *color;
-
-	color = calloc(1, sizeof(gfx_color_t));
-	if (color == NULL)
-		return ENOMEM;
-
-	color->attr = attr;
-
-	*rcolor = color;
-	return EOK;
-}
-
 /** Delete color.
  *
@@ -115,14 +93,4 @@
 }
 
-/** Convert color to EGA attributes.
- *
- * @param color Color
- * @param attr Place to store EGA attributes
- */
-void gfx_color_get_ega(gfx_color_t *color, uint8_t *attr)
-{
-	*attr = color->attr;
-}
-
 /** @}
  */
Index: pace/lib/gfx/src/cursor.c
===================================================================
--- uspace/lib/gfx/src/cursor.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libgfx
- * @{
- */
-/**
- * @file Hardware cursor control
- */
-
-#include <errno.h>
-#include <gfx/context.h>
-#include <gfx/coord.h>
-#include <gfx/cursor.h>
-#include <gfx/render.h>
-#include <stdbool.h>
-#include "../private/context.h"
-
-/** Get hardware cursor position.
- *
- * @param gc Graphic context
- * @param pos Place to store cursor position
- *
- * @return EOK on success, ENOTSUP if not supported,
- *         EIO if grahic device connection was lost
- */
-errno_t gfx_cursor_get_pos(gfx_context_t *gc, gfx_coord2_t *pos)
-{
-	if (gc->ops->cursor_get_pos != NULL)
-		return gc->ops->cursor_get_pos(gc->arg, pos);
-	else
-		return ENOTSUP;
-}
-
-/** Set hardware cursor position.
- *
- * @param gc Graphic context
- * @param pos New cursor position
- *
- * @return EOK on success, ENOTSUP if not supported,
- *         EIO if grahic device connection was lost
- */
-errno_t gfx_cursor_set_pos(gfx_context_t *gc, gfx_coord2_t *pos)
-{
-	if (gc->ops->cursor_set_pos != NULL)
-		return gc->ops->cursor_set_pos(gc->arg, pos);
-	else
-		return ENOTSUP;
-}
-
-/** Set hardware cursor visibility.
- *
- * @param gc Graphic context
- * @param visible @c true iff cursor should be made visible
- *
- * @return EOK on success, ENOTSUP if not supported,
- *         EIO if grahic device connection was lost
- */
-errno_t gfx_cursor_set_visible(gfx_context_t *gc, bool visible)
-{
-	if (gc->ops->cursor_set_visible != NULL)
-		return gc->ops->cursor_set_visible(gc->arg, visible);
-	else
-		return ENOTSUP;
-}
-
-/** @}
- */
Index: pace/lib/gfx/test/cursor.c
===================================================================
--- uspace/lib/gfx/test/cursor.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,265 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <gfx/context.h>
-#include <gfx/cursor.h>
-#include <pcut/pcut.h>
-#include <mem.h>
-#include <stdbool.h>
-
-PCUT_INIT;
-
-PCUT_TEST_SUITE(cursor);
-
-static errno_t testgc_cursor_get_pos(void *, gfx_coord2_t *);
-static errno_t testgc_cursor_set_pos(void *, gfx_coord2_t *);
-static errno_t testgc_cursor_set_visible(void *, bool);
-
-static gfx_context_ops_t ops = {
-	.cursor_get_pos = testgc_cursor_get_pos,
-	.cursor_set_pos = testgc_cursor_set_pos,
-	.cursor_set_visible = testgc_cursor_set_visible
-};
-
-/** Test graphics context data */
-typedef struct {
-	errno_t rc;
-
-	bool cursor_get_pos;
-	gfx_coord2_t get_pos_pos;
-
-	bool cursor_set_pos;
-	gfx_coord2_t set_pos_pos;
-
-	bool cursor_set_visible;
-	bool set_visible_vis;
-} test_gc_t;
-
-/** Get hardware cursor position with error return */
-PCUT_TEST(cursor_get_pos_failure)
-{
-	errno_t rc;
-	gfx_coord2_t pos;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-
-	memset(&tgc, 0, sizeof(tgc));
-
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	tgc.rc = EIO;
-
-	rc = gfx_cursor_get_pos(gc, &pos);
-	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_get_pos);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Get hardware cursor position */
-PCUT_TEST(cursor_get_pos_success)
-{
-	errno_t rc;
-	gfx_coord2_t pos;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-
-	memset(&tgc, 0, sizeof(tgc));
-
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	tgc.rc = EOK;
-	tgc.get_pos_pos.x = 1;
-	tgc.get_pos_pos.y = 2;
-
-	rc = gfx_cursor_get_pos(gc, &pos);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_get_pos);
-	PCUT_ASSERT_INT_EQUALS(tgc.get_pos_pos.x, pos.x);
-	PCUT_ASSERT_INT_EQUALS(tgc.get_pos_pos.y, pos.y);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Set hardware cursor position with error return */
-PCUT_TEST(cursor_set_pos_failure)
-{
-	errno_t rc;
-	gfx_coord2_t pos;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-
-	memset(&tgc, 0, sizeof(tgc));
-
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	tgc.rc = EIO;
-	pos.x = 1;
-	pos.y = 2;
-
-	rc = gfx_cursor_set_pos(gc, &pos);
-	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_set_pos);
-	PCUT_ASSERT_INT_EQUALS(pos.x, tgc.set_pos_pos.x);
-	PCUT_ASSERT_INT_EQUALS(pos.y, tgc.set_pos_pos.y);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Set hardware cursor position */
-PCUT_TEST(cursor_set_pos_success)
-{
-	errno_t rc;
-	gfx_coord2_t pos;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-
-	memset(&tgc, 0, sizeof(tgc));
-
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	tgc.rc = EOK;
-	pos.x = 1;
-	pos.y = 2;
-
-	rc = gfx_cursor_set_pos(gc, &pos);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_set_pos);
-	PCUT_ASSERT_INT_EQUALS(pos.x, tgc.set_pos_pos.x);
-	PCUT_ASSERT_INT_EQUALS(pos.y, tgc.set_pos_pos.y);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Set hardware cursor visibility with error return */
-PCUT_TEST(cursor_set_visible_failure)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-
-	memset(&tgc, 0, sizeof(tgc));
-
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	tgc.rc = EIO;
-
-	rc = gfx_cursor_set_visible(gc, true);
-	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
-	PCUT_ASSERT_TRUE(tgc.set_visible_vis);
-
-	tgc.cursor_set_visible = false;
-
-	rc = gfx_cursor_set_visible(gc, false);
-	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
-	PCUT_ASSERT_FALSE(tgc.set_visible_vis);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Set hardware cursor visibility */
-PCUT_TEST(cursor_set_visible_success)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-
-	memset(&tgc, 0, sizeof(tgc));
-
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	tgc.rc = EOK;
-
-	rc = gfx_cursor_set_visible(gc, true);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
-	PCUT_ASSERT_TRUE(tgc.set_visible_vis);
-
-	tgc.cursor_set_visible = false;
-
-	rc = gfx_cursor_set_visible(gc, false);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
-	PCUT_ASSERT_FALSE(tgc.set_visible_vis);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-static errno_t testgc_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	test_gc_t *tgc = (test_gc_t *) arg;
-
-	tgc->cursor_get_pos = true;
-	*pos = tgc->get_pos_pos;
-
-	return tgc->rc;
-}
-
-static errno_t testgc_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	test_gc_t *tgc = (test_gc_t *) arg;
-
-	tgc->cursor_set_pos = true;
-	tgc->set_pos_pos = *pos;
-
-	return tgc->rc;
-}
-
-static errno_t testgc_cursor_set_visible(void *arg, bool visible)
-{
-	test_gc_t *tgc = (test_gc_t *) arg;
-
-	tgc->cursor_set_visible = true;
-	tgc->set_visible_vis = visible;
-
-	return tgc->rc;
-}
-
-PCUT_EXPORT(cursor);
Index: uspace/lib/gfx/test/main.c
===================================================================
--- uspace/lib/gfx/test/main.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfx/test/main.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2017 Jiri Svoboda
  * All rights reserved.
  *
@@ -34,5 +34,4 @@
 PCUT_IMPORT(color);
 PCUT_IMPORT(coord);
-PCUT_IMPORT(cursor);
 PCUT_IMPORT(render);
 
Index: uspace/lib/gfxfont/include/gfx/text.h
===================================================================
--- uspace/lib/gfxfont/include/gfx/text.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfxfont/include/gfx/text.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -46,12 +46,4 @@
 extern errno_t gfx_puttext(gfx_font_t *, gfx_coord2_t *, gfx_text_fmt_t *,
     const char *);
-extern void gfx_text_start_pos(gfx_font_t *, gfx_coord2_t *, gfx_text_fmt_t *,
-    const char *, gfx_coord2_t *);
-extern size_t gfx_text_find_pos(gfx_font_t *, gfx_coord2_t *, gfx_text_fmt_t *,
-    const char *, gfx_coord2_t *);
-extern void gfx_text_cont(gfx_font_t *, gfx_coord2_t *, gfx_text_fmt_t *,
-    const char *, gfx_coord2_t *, gfx_text_fmt_t *);
-extern void gfx_text_rect(gfx_font_t *, gfx_coord2_t *, gfx_text_fmt_t *,
-    const char *, gfx_rect_t *);
 
 #endif
Index: uspace/lib/gfxfont/include/types/gfx/text.h
===================================================================
--- uspace/lib/gfxfont/include/types/gfx/text.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfxfont/include/types/gfx/text.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -42,9 +42,9 @@
 /** Text horizontal alignment */
 typedef enum {
-	/** Align text left (start at anchor point) */
+	/** Align text left */
 	gfx_halign_left,
-	/** Align text on the center (center around anchor point) */
+	/** Align text on the center */
 	gfx_halign_center,
-	/** Align text right (end just before anchor point) */
+	/** Align text right */
 	gfx_halign_right,
 	/** Justify text on both left and right edge */
@@ -54,9 +54,9 @@
 /** Text vertical alignment */
 typedef enum {
-	/** Align top (starts at anchor point) */
+	/** Align top */
 	gfx_valign_top,
-	/** Align center (centered around anchor point) */
+	/** Align center */
 	gfx_valign_center,
-	/** Align bottom (end just before anchor point) */
+	/** Align bottom */
 	gfx_valign_bottom,
 	/** Align to baseline */
Index: uspace/lib/gfxfont/src/text.c
===================================================================
--- uspace/lib/gfxfont/src/text.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfxfont/src/text.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -110,10 +110,8 @@
 	gfx_bitmap_t *bitmap;
 	gfx_bitmap_alloc_t alloc;
-	uint8_t attr;
+	uint16_t r, g, b;
 	pixelmap_t pmap;
 	gfx_coord_t x;
 	pixel_t pixel;
-	char32_t c;
-	size_t off;
 	errno_t rc;
 
@@ -123,5 +121,13 @@
 	 */
 
-	gfx_color_get_ega(color, &attr);
+	gfx_color_get_rgb_i16(color, &r, &g, &b);
+
+	/*
+	 * We are setting the *background* color, the foreground color
+	 * will be set to its complement.
+	 */
+	r = 0xff ^ (r >> 8);
+	g = 0xff ^ (g >> 8);
+	b = 0xff ^ (b >> 8);
 
 	gfx_bitmap_params_init(&params);
@@ -150,11 +156,6 @@
 	pmap.data = alloc.pixels;
 
-	off = 0;
 	for (x = 0; x < params.rect.p1.x; x++) {
-		c = str_decode(str, &off, STR_NO_LIMIT);
-		pixel = PIXEL(attr,
-		    (c >> 16) & 0xff,
-		    (c >> 8) & 0xff,
-		    c & 0xff);
+		pixel = PIXEL(str[x], r, g, b);
 		pixelmap_put_pixel(&pmap, x, 0, pixel);
 	}
@@ -166,5 +167,5 @@
 }
 
-/** Get text starting position.
+/** Render text.
  *
  * @param font Font
@@ -172,13 +173,19 @@
  * @param fmt Text formatting
  * @param str String
- * @param spos Place to store starting position
- */
-void gfx_text_start_pos(gfx_font_t *font, gfx_coord2_t *pos,
-    gfx_text_fmt_t *fmt, const char *str, gfx_coord2_t *spos)
+ * @return EOK on success or an error code
+ */
+errno_t gfx_puttext(gfx_font_t *font, gfx_coord2_t *pos,
+    gfx_text_fmt_t *fmt, const char *str)
 {
 	gfx_font_metrics_t fmetrics;
+	gfx_glyph_metrics_t gmetrics;
+	size_t stradv;
+	const char *cp;
+	gfx_glyph_t *glyph;
+	gfx_coord2_t cpos;
 	gfx_coord_t width;
-
-	*spos = *pos;
+	errno_t rc;
+
+	cpos = *pos;
 
 	/* Adjust position for horizontal alignment */
@@ -187,8 +194,8 @@
 		switch (fmt->halign) {
 		case gfx_halign_center:
-			spos->x -= width / 2;
+			cpos.x -= width / 2;
 			break;
 		case gfx_halign_right:
-			spos->x -= width;
+			cpos.x -= width - 1;
 			break;
 		default:
@@ -203,11 +210,11 @@
 		switch (fmt->valign) {
 		case gfx_valign_top:
-			spos->y += fmetrics.ascent;
+			cpos.y += fmetrics.ascent;
 			break;
 		case gfx_valign_center:
-			spos->y += fmetrics.ascent / 2;
+			cpos.y += fmetrics.ascent / 2;
 			break;
 		case gfx_valign_bottom:
-			spos->y -= fmetrics.descent + 1;
+			cpos.y -= fmetrics.descent;
 			break;
 		default:
@@ -215,25 +222,4 @@
 		}
 	}
-}
-
-/** Render text.
- *
- * @param font Font
- * @param pos Anchor position
- * @param fmt Text formatting
- * @param str String
- * @return EOK on success or an error code
- */
-errno_t gfx_puttext(gfx_font_t *font, gfx_coord2_t *pos,
-    gfx_text_fmt_t *fmt, const char *str)
-{
-	gfx_glyph_metrics_t gmetrics;
-	size_t stradv;
-	const char *cp;
-	gfx_glyph_t *glyph;
-	gfx_coord2_t cpos;
-	errno_t rc;
-
-	gfx_text_start_pos(font, pos, fmt, str, &cpos);
 
 	/* Text mode */
@@ -266,126 +252,4 @@
 }
 
-/** Find character position in string by X coordinate.
- *
- * @param font Font
- * @param pos Anchor position
- * @param fmt Text formatting
- * @param str String
- * @param fpos Position for which we need to find offset
- *
- * @return Byte offset in @a str of character corresponding to position
- *         @a fpos. Note that the position is rounded, that is,
- *         if it is before the center of character A, it will return
- *         offset of A, if it is after the center of A, it will return
- *         offset of the following character.
- */
-size_t gfx_text_find_pos(gfx_font_t *font, gfx_coord2_t *pos,
-    gfx_text_fmt_t *fmt, const char *str, gfx_coord2_t *fpos)
-{
-	gfx_glyph_metrics_t gmetrics;
-	size_t stradv;
-	const char *cp;
-	gfx_glyph_t *glyph;
-	gfx_coord2_t cpos;
-	size_t off;
-	size_t strsize;
-	errno_t rc;
-
-	gfx_text_start_pos(font, pos, fmt, str, &cpos);
-
-	/* Text mode */
-	if ((font->finfo->props.flags & gff_text_mode) != 0) {
-		off = 0;
-		strsize = str_size(str);
-		while (off < strsize) {
-			if (fpos->x <= cpos.x)
-				return off;
-			(void) str_decode(str, &off, strsize);
-			cpos.x++;
-		}
-
-		return off;
-	}
-
-	cp = str;
-	off = 0;
-	while (*cp != '\0') {
-		rc = gfx_font_search_glyph(font, cp, &glyph, &stradv);
-		if (rc != EOK) {
-			++cp;
-			continue;
-		}
-
-		gfx_glyph_get_metrics(glyph, &gmetrics);
-
-		if (fpos->x < cpos.x + gmetrics.advance / 2)
-			return off;
-
-		cp += stradv;
-		off += stradv;
-		cpos.x += gmetrics.advance;
-	}
-
-	return off;
-}
-
-/** Get text continuation parameters.
- *
- * Return the anchor position and format needed to continue printing
- * text after the specified string. It is allowed for the sources
- * (@a pos, @a fmt) and destinations (@a cpos, @a cfmt) to point
- * to the same objects, respectively.
- *
- * @param font Font
- * @param pos Anchor position
- * @param fmt Text formatting
- * @param str String
- * @param cpos Place to store anchor position for continuation
- * @param cfmt Place to store format for continuation
- */
-void gfx_text_cont(gfx_font_t *font, gfx_coord2_t *pos,
-    gfx_text_fmt_t *fmt, const char *str, gfx_coord2_t *cpos,
-    gfx_text_fmt_t *cfmt)
-{
-	gfx_coord2_t spos;
-	gfx_text_fmt_t tfmt;
-
-	/* Continuation should start where the current string ends */
-	gfx_text_start_pos(font, pos, fmt, str, &spos);
-	cpos->x = spos.x + gfx_text_width(font, str);
-	cpos->y = spos.y;
-
-	/*
-	 * Formatting is the same, except the text should be aligned
-	 * so that it starts at the anchor point.
-	 */
-	tfmt = *fmt;
-	tfmt.halign = gfx_halign_left;
-	tfmt.valign = gfx_valign_baseline;
-
-	*cfmt = tfmt;
-}
-
-/** Get text bounding rectangle.
- *
- * @param font Font
- * @param pos Anchor position
- * @param fmt Text formatting
- * @param str String
- * @param rect Place to store bounding rectangle
- */
-void gfx_text_rect(gfx_font_t *font, gfx_coord2_t *pos,
-    gfx_text_fmt_t *fmt, const char *str, gfx_rect_t *rect)
-{
-	gfx_coord2_t spos;
-
-	gfx_text_start_pos(font, pos, fmt, str, &spos);
-
-	rect->p0.x = spos.x;
-	rect->p0.y = spos.y - font->metrics.ascent;
-	rect->p1.x = spos.x + gfx_text_width(font, str);
-	rect->p1.y = spos.y + font->metrics.descent + 1;
-}
-
 /** @}
  */
Index: uspace/lib/gfxfont/test/text.c
===================================================================
--- uspace/lib/gfxfont/test/text.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/gfxfont/test/text.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -30,5 +30,4 @@
 #include <gfx/context.h>
 #include <gfx/font.h>
-#include <gfx/glyph.h>
 #include <gfx/text.h>
 #include <gfx/typeface.h>
@@ -141,302 +140,4 @@
 	rc = gfx_puttext(font, &pos, &fmt, "Hello world!");
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_font_close(font);
-	gfx_typeface_destroy(tface);
-	gfx_color_delete(color);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** gfx_text_start_pos() correctly computes text start position */
-PCUT_TEST(text_start_pos)
-{
-	gfx_font_props_t props;
-	gfx_font_metrics_t metrics;
-	gfx_typeface_t *tface;
-	gfx_font_t *font;
-	gfx_context_t *gc;
-	gfx_color_t *color;
-	gfx_text_fmt_t fmt;
-	gfx_coord2_t pos;
-	test_gc_t tgc;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *)&tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_color_new_rgb_i16(0, 0, 0, &color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_typeface_create(gc, &tface);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_font_props_init(&props);
-	gfx_font_metrics_init(&metrics);
-	metrics.ascent = 10; // XXX
-	metrics.descent = 10; // XXX
-	rc = gfx_font_create(tface, &props, &metrics, &font);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_text_fmt_init(&fmt);
-	fmt.color = color;
-	pos.x = 0;
-	pos.y = 0;
-
-	rc = gfx_puttext(font, &pos, &fmt, "Hello world!");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_font_close(font);
-	gfx_typeface_destroy(tface);
-	gfx_color_delete(color);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** gfx_text_find_pos() finds position in text */
-PCUT_TEST(text_find_pos)
-{
-	gfx_font_props_t props;
-	gfx_font_metrics_t metrics;
-	gfx_typeface_t *tface;
-	gfx_font_t *font;
-	gfx_glyph_metrics_t gmetrics;
-	gfx_glyph_t *glyph1;
-	gfx_glyph_t *glyph2;
-	gfx_context_t *gc;
-	gfx_text_fmt_t fmt;
-	gfx_coord2_t anchor;
-	gfx_coord2_t fpos;
-	size_t off;
-	test_gc_t tgc;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *)&tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_typeface_create(gc, &tface);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_font_props_init(&props);
-	gfx_font_metrics_init(&metrics);
-	rc = gfx_font_create(tface, &props, &metrics, &font);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	/* Need to create some glyphs with metrics */
-	gfx_glyph_metrics_init(&gmetrics);
-	gmetrics.advance = 10;
-
-	rc = gfx_glyph_create(font, &gmetrics, &glyph1);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_glyph_set_pattern(glyph1, "A");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_glyph_metrics_init(&gmetrics);
-	gmetrics.advance = 1;
-
-	rc = gfx_glyph_create(font, &gmetrics, &glyph2);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_glyph_set_pattern(glyph2, "i");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_text_fmt_init(&fmt);
-	anchor.x = 10;
-	anchor.y = 0;
-
-	fpos.x = 9;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Aii", &fpos);
-	PCUT_ASSERT_INT_EQUALS(0, off);
-
-	fpos.x = 10;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Aii", &fpos);
-	PCUT_ASSERT_INT_EQUALS(0, off);
-
-	fpos.x = 11;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Aii", &fpos);
-	PCUT_ASSERT_INT_EQUALS(0, off);
-
-	fpos.x = 19;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Aii", &fpos);
-	PCUT_ASSERT_INT_EQUALS(1, off);
-
-	fpos.x = 20;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Aii", &fpos);
-	PCUT_ASSERT_INT_EQUALS(2, off);
-
-	fpos.x = 21;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Aii", &fpos);
-	PCUT_ASSERT_INT_EQUALS(3, off);
-
-	fpos.x = 22;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Aii", &fpos);
-	PCUT_ASSERT_INT_EQUALS(3, off);
-
-	gfx_glyph_destroy(glyph1);
-	gfx_glyph_destroy(glyph2);
-
-	gfx_font_close(font);
-	gfx_typeface_destroy(tface);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** gfx_text_find_pos() finds position in text in text mode */
-PCUT_TEST(text_find_pos_text)
-{
-	gfx_typeface_t *tface;
-	gfx_font_t *font;
-	gfx_context_t *gc;
-	test_gc_t tgc;
-	size_t off;
-	gfx_text_fmt_t fmt;
-	gfx_coord2_t anchor;
-	gfx_coord2_t fpos;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *)&tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_typeface_create(gc, &tface);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_font_create_textmode(tface, &font);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	anchor.x = 10;
-	anchor.y = 0;
-	gfx_text_fmt_init(&fmt);
-
-	fpos.x = 9;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Abc", &fpos);
-	PCUT_ASSERT_INT_EQUALS(0, off);
-
-	fpos.x = 10;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Abc", &fpos);
-	PCUT_ASSERT_INT_EQUALS(0, off);
-
-	fpos.x = 11;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Abc", &fpos);
-	PCUT_ASSERT_INT_EQUALS(1, off);
-
-	fpos.x = 12;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Abc", &fpos);
-	PCUT_ASSERT_INT_EQUALS(2, off);
-
-	fpos.x = 13;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Abc", &fpos);
-	PCUT_ASSERT_INT_EQUALS(3, off);
-
-	fpos.x = 14;
-	fpos.y = 0;
-	off = gfx_text_find_pos(font, &anchor, &fmt, "Abc", &fpos);
-	PCUT_ASSERT_INT_EQUALS(3, off);
-
-	gfx_font_close(font);
-	gfx_typeface_destroy(tface);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** gfx_text_cont() produces correct continuation parameters */
-PCUT_TEST(text_cont)
-{
-	gfx_typeface_t *tface;
-	gfx_font_t *font;
-	gfx_context_t *gc;
-	gfx_color_t *color;
-	test_gc_t tgc;
-	gfx_text_fmt_t fmt;
-	gfx_coord2_t anchor;
-	gfx_coord2_t cpos;
-	gfx_text_fmt_t cfmt;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *)&tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_typeface_create(gc, &tface);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_font_create_textmode(tface, &font);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_color_new_rgb_i16(0, 0, 0, &color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	anchor.x = 10;
-	anchor.y = 20;
-	gfx_text_fmt_init(&fmt);
-	fmt.color = color;
-
-	gfx_text_cont(font, &anchor, &fmt, "Abc", &cpos, &cfmt);
-
-	PCUT_ASSERT_INT_EQUALS(13, cpos.x);
-	PCUT_ASSERT_INT_EQUALS(20, cpos.y);
-	PCUT_ASSERT_EQUALS(fmt.color, cfmt.color);
-	PCUT_ASSERT_EQUALS(gfx_halign_left, cfmt.halign);
-	PCUT_ASSERT_EQUALS(gfx_valign_baseline, cfmt.valign);
-
-	gfx_font_close(font);
-	gfx_typeface_destroy(tface);
-	gfx_color_delete(color);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** gfx_text_rect() computes bounding rectangle */
-PCUT_TEST(text_rect)
-{
-	gfx_typeface_t *tface;
-	gfx_font_t *font;
-	gfx_context_t *gc;
-	gfx_color_t *color;
-	test_gc_t tgc;
-	gfx_text_fmt_t fmt;
-	gfx_coord2_t anchor;
-	gfx_rect_t rect;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *)&tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_typeface_create(gc, &tface);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_font_create_textmode(tface, &font);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = gfx_color_new_rgb_i16(0, 0, 0, &color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	anchor.x = 10;
-	anchor.y = 20;
-	gfx_text_fmt_init(&fmt);
-	fmt.color = color;
-
-	gfx_text_rect(font, &anchor, &fmt, "Abc", &rect);
-
-	PCUT_ASSERT_INT_EQUALS(10, rect.p0.x);
-	PCUT_ASSERT_INT_EQUALS(20, rect.p0.y);
-	PCUT_ASSERT_INT_EQUALS(13, rect.p1.x);
-	PCUT_ASSERT_INT_EQUALS(21, rect.p1.y);
 
 	gfx_font_close(font);
Index: uspace/lib/inet/include/inet/addr.h
===================================================================
--- uspace/lib/inet/include/inet/addr.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/addr.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,13 +33,12 @@
  */
 
-#ifndef LIBINET_INET_ADDR_H
-#define LIBINET_INET_ADDR_H
+#ifndef _LIBC_INET_ADDR_H_
+#define _LIBC_INET_ADDR_H_
 
 #include <errno.h>
-#include <inet/eth_addr.h>
 #include <stdint.h>
 
 typedef uint32_t addr32_t;
-
+typedef uint8_t addr48_t[6];
 typedef uint8_t addr128_t[16];
 
@@ -79,9 +78,13 @@
 
 extern const addr32_t addr32_broadcast_all_hosts;
+extern const addr48_t addr48_broadcast;
 
+extern void addr48(const addr48_t, addr48_t);
 extern void addr128(const addr128_t, addr128_t);
 
+extern int addr48_compare(const addr48_t, const addr48_t);
 extern int addr128_compare(const addr128_t, const addr128_t);
-extern void eth_addr_solicited_node(const addr128_t, eth_addr_t *);
+
+extern void addr48_solicited_node(const addr128_t, addr48_t);
 
 extern void host2addr128_t_be(const addr128_t, addr128_t);
Index: uspace/lib/inet/include/inet/dhcp.h
===================================================================
--- uspace/lib/inet/include/inet/dhcp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/dhcp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_DHCP_H
-#define LIBINET_INET_DHCP_H
+#ifndef _LIBC_INET_DHCP_H_
+#define _LIBC_INET_DHCP_H_
 
 #include <types/common.h>
Index: uspace/lib/inet/include/inet/dnsr.h
===================================================================
--- uspace/lib/inet/include/inet/dnsr.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/dnsr.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_DNSR_H
-#define LIBINET_INET_DNSR_H
+#ifndef _LIBC_INET_DNSR_H_
+#define _LIBC_INET_DNSR_H_
 
 #include <inet/inet.h>
Index: uspace/lib/inet/include/inet/endpoint.h
===================================================================
--- uspace/lib/inet/include/inet/endpoint.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/endpoint.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_ENDPOINT_H
-#define LIBINET_INET_ENDPOINT_H
+#ifndef _LIBC_INET_ENDPOINT_H_
+#define _LIBC_INET_ENDPOINT_H_
 
 #include <stdint.h>
Index: pace/lib/inet/include/inet/eth_addr.h
===================================================================
--- uspace/lib/inet/include/inet/eth_addr.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libinet
- * @{
- */
-/**
- * @file
- * @brief
- */
-
-#ifndef LIBINET_INET_ETH_ADDR_H
-#define LIBINET_INET_ETH_ADDR_H
-
-#include <stdint.h>
-
-#define ETH_ADDR_SIZE 6
-#define ETH_ADDR_STR_SIZE (6 * 2 + 5)
-
-#define ETH_ADDR_INITIALIZER(aa, bb, cc, dd, ee, ff) \
-    { .a = ((uint64_t)(aa) << 40) | ((uint64_t)(bb) << 32) | \
-    ((uint64_t)(cc) << 24) | ((uint64_t)(dd) << 16) | \
-    ((uint64_t)(ee) << 8) | (ff) }
-
-/** Ethernet address.
- *
- * Defined as a structure. This provides strong type checking.
- *
- * Since the structure is not opaque, this allows eth_addr_t to be
- * allocated statically and copied around using the assignment operator.
- *
- * It is stored in the lower 48 bits of a 64-bit integer. This is an internal
- * representation that allows simple and efficient operation. Most CPUs
- * will be much faster (and we will need less instructions) operating
- * on a single 64-bit integer than on six individual 8-bit integers.
- *
- * Kind reader will appreciate the cleverness and elegance of this
- * representation.
- */
-typedef struct {
-	uint64_t a;
-} eth_addr_t;
-
-/** Ethernet address in the form of a string */
-typedef struct {
-	char str[ETH_ADDR_STR_SIZE + 1];
-} eth_addr_str_t;
-
-extern const eth_addr_t eth_addr_broadcast;
-
-extern void eth_addr_encode(eth_addr_t *, uint8_t *);
-extern void eth_addr_decode(const uint8_t *, eth_addr_t *);
-
-extern int eth_addr_compare(const eth_addr_t *, const eth_addr_t *);
-extern void eth_addr_format(eth_addr_t *, eth_addr_str_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/inet/include/inet/host.h
===================================================================
--- uspace/lib/inet/include/inet/host.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/host.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_HOST_H
-#define LIBINET_INET_HOST_H
+#ifndef _LIBC_INET_HOST_H_
+#define _LIBC_INET_HOST_H_
 
 #include <inet/addr.h>
Index: uspace/lib/inet/include/inet/hostname.h
===================================================================
--- uspace/lib/inet/include/inet/hostname.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/hostname.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_HOSTNAME_H
-#define LIBINET_INET_HOSTNAME_H
+#ifndef _LIBC_INET_HOSTNAME_H_
+#define _LIBC_INET_HOSTNAME_H_
 
 extern errno_t inet_hostname_parse(const char *, char **, char **);
Index: uspace/lib/inet/include/inet/hostport.h
===================================================================
--- uspace/lib/inet/include/inet/hostport.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/hostport.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_HOSTPORT_H
-#define LIBINET_INET_HOSTPORT_H
+#ifndef _LIBC_INET_HOSTPORT_H_
+#define _LIBC_INET_HOSTPORT_H_
 
 #include <inet/addr.h>
Index: uspace/lib/inet/include/inet/inet.h
===================================================================
--- uspace/lib/inet/include/inet/inet.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/inet.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_INET_H
-#define LIBINET_INET_INET_H
+#ifndef _LIBC_INET_INET_H_
+#define _LIBC_INET_INET_H_
 
 #include <inet/addr.h>
Index: uspace/lib/inet/include/inet/inetcfg.h
===================================================================
--- uspace/lib/inet/include/inet/inetcfg.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/inetcfg.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_INETCFG_H
-#define LIBINET_INET_INETCFG_H
+#ifndef _LIBC_INET_INETCFG_H_
+#define _LIBC_INET_INETCFG_H_
 
 #include <inet/inet.h>
Index: uspace/lib/inet/include/inet/inetping.h
===================================================================
--- uspace/lib/inet/include/inet/inetping.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/inetping.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_INETPING_H
-#define LIBINET_INET_INETPING_H
+#ifndef _LIBC_INET_INETPING_H_
+#define _LIBC_INET_INETPING_H_
 
 #include <inet/inet.h>
Index: uspace/lib/inet/include/inet/iplink.h
===================================================================
--- uspace/lib/inet/include/inet/iplink.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/iplink.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,10 +33,9 @@
  */
 
-#ifndef LIBINET_INET_IPLINK_H
-#define LIBINET_INET_IPLINK_H
+#ifndef _LIBC_INET_IPLINK_H_
+#define _LIBC_INET_IPLINK_H_
 
 #include <async.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 
 struct iplink_ev_ops;
@@ -63,5 +62,5 @@
 typedef struct {
 	/** Local MAC destination address */
-	eth_addr_t dest;
+	addr48_t dest;
 	/** Serialized IP packet */
 	void *data;
@@ -80,5 +79,5 @@
 typedef struct iplink_ev_ops {
 	errno_t (*recv)(iplink_t *, iplink_recv_sdu_t *, ip_ver_t);
-	errno_t (*change_addr)(iplink_t *, eth_addr_t *);
+	errno_t (*change_addr)(iplink_t *, addr48_t);
 } iplink_ev_ops_t;
 
@@ -90,6 +89,6 @@
 extern errno_t iplink_addr_remove(iplink_t *, inet_addr_t *);
 extern errno_t iplink_get_mtu(iplink_t *, size_t *);
-extern errno_t iplink_get_mac48(iplink_t *, eth_addr_t *);
-extern errno_t iplink_set_mac48(iplink_t *, eth_addr_t *);
+extern errno_t iplink_get_mac48(iplink_t *, addr48_t *);
+extern errno_t iplink_set_mac48(iplink_t *, addr48_t);
 extern void *iplink_get_userptr(iplink_t *);
 
Index: uspace/lib/inet/include/inet/iplink_srv.h
===================================================================
--- uspace/lib/inet/include/inet/iplink_srv.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/iplink_srv.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,13 +33,12 @@
  */
 
-#ifndef LIBINET_INET_IPLINK_SRV_H
-#define LIBINET_INET_IPLINK_SRV_H
+#ifndef _LIBC_INET_IPLINK_SRV_H_
+#define _LIBC_INET_IPLINK_SRV_H_
 
 #include <async.h>
 #include <fibril_synch.h>
+#include <stdbool.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink.h>
-#include <stdbool.h>
 
 struct iplink_ops;
@@ -59,6 +58,6 @@
 	errno_t (*send6)(iplink_srv_t *, iplink_sdu6_t *);
 	errno_t (*get_mtu)(iplink_srv_t *, size_t *);
-	errno_t (*get_mac48)(iplink_srv_t *, eth_addr_t *);
-	errno_t (*set_mac48)(iplink_srv_t *, eth_addr_t *);
+	errno_t (*get_mac48)(iplink_srv_t *, addr48_t *);
+	errno_t (*set_mac48)(iplink_srv_t *, addr48_t *);
 	errno_t (*addr_add)(iplink_srv_t *, inet_addr_t *);
 	errno_t (*addr_remove)(iplink_srv_t *, inet_addr_t *);
@@ -69,5 +68,5 @@
 extern errno_t iplink_conn(ipc_call_t *, void *);
 extern errno_t iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, ip_ver_t);
-extern errno_t iplink_ev_change_addr(iplink_srv_t *, eth_addr_t *);
+extern errno_t iplink_ev_change_addr(iplink_srv_t *, addr48_t *);
 
 #endif
Index: uspace/lib/inet/include/inet/tcp.h
===================================================================
--- uspace/lib/inet/include/inet/tcp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/tcp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_TCP_H
-#define LIBINET_INET_TCP_H
+#ifndef _LIBC_INET_TCP_H_
+#define _LIBC_INET_TCP_H_
 
 #include <fibril_synch.h>
Index: uspace/lib/inet/include/inet/udp.h
===================================================================
--- uspace/lib/inet/include/inet/udp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/inet/udp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_INET_UDP_H
-#define LIBINET_INET_UDP_H
+#ifndef _LIBC_INET_UDP_H_
+#define _LIBC_INET_UDP_H_
 
 #include <async.h>
Index: uspace/lib/inet/include/ipc/dhcp.h
===================================================================
--- uspace/lib/inet/include/ipc/dhcp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/ipc/dhcp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_IPC_DHCP_H
-#define LIBINET_IPC_DHCP_H
+#ifndef _LIBC_IPC_DHCP_H_
+#define _LIBC_IPC_DHCP_H_
 
 #include <ipc/common.h>
Index: uspace/lib/inet/include/ipc/dnsr.h
===================================================================
--- uspace/lib/inet/include/ipc/dnsr.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/ipc/dnsr.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,10 +27,10 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libcipc
  * @{
  */
 
-#ifndef LIBINET_IPC_DNSR_H
-#define LIBINET_IPC_DNSR_H
+#ifndef _LIBC_IPC_DNSR_H_
+#define _LIBC_IPC_DNSR_H_
 
 #include <ipc/common.h>
Index: uspace/lib/inet/include/ipc/inet.h
===================================================================
--- uspace/lib/inet/include/ipc/inet.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/ipc/inet.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_IPC_INET_H
-#define LIBINET_IPC_INET_H
+#ifndef _LIBC_IPC_INET_H_
+#define _LIBC_IPC_INET_H_
 
 #include <ipc/common.h>
Index: uspace/lib/inet/include/ipc/iplink.h
===================================================================
--- uspace/lib/inet/include/ipc/iplink.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/ipc/iplink.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_IPC_IPLINK_H
-#define LIBINET_IPC_IPLINK_H
+#ifndef _LIBC_IPC_IPLINK_H_
+#define _LIBC_IPC_IPLINK_H_
 
 #include <ipc/common.h>
Index: uspace/lib/inet/include/ipc/tcp.h
===================================================================
--- uspace/lib/inet/include/ipc/tcp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/ipc/tcp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_IPC_TCP_H
-#define LIBINET_IPC_TCP_H
+#ifndef _LIBC_IPC_TCP_H_
+#define _LIBC_IPC_TCP_H_
 
 #include <ipc/common.h>
Index: uspace/lib/inet/include/ipc/udp.h
===================================================================
--- uspace/lib/inet/include/ipc/udp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/ipc/udp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libcipc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_IPC_UDP_H
-#define LIBINET_IPC_UDP_H
+#ifndef _LIBC_IPC_UDP_H_
+#define _LIBC_IPC_UDP_H_
 
 #include <ipc/common.h>
Index: uspace/lib/inet/include/types/inet.h
===================================================================
--- uspace/lib/inet/include/types/inet.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/types/inet.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_TYPES_INET_H
-#define LIBINET_TYPES_INET_H
+#ifndef _LIBC_TYPES_INET_H_
+#define _LIBC_TYPES_INET_H_
 
 #include <inet/addr.h>
Index: uspace/lib/inet/include/types/inet/host.h
===================================================================
--- uspace/lib/inet/include/types/inet/host.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/types/inet/host.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINETTYPES_INET_HOST_H
-#define LIBINETTYPES_INET_HOST_H
+#ifndef _LIBC_TYPES_INET_HOST_H_
+#define _LIBC_TYPES_INET_HOST_H_
 
 #include <inet/addr.h>
Index: uspace/lib/inet/include/types/inet/hostport.h
===================================================================
--- uspace/lib/inet/include/types/inet/hostport.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/types/inet/hostport.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,6 +33,6 @@
  */
 
-#ifndef LIBINET_TYPES_INET_HOSTPORT_H
-#define LIBINET_TYPES_INET_HOSTPORT_H
+#ifndef _LIBC_TYPES_INET_HOSTPORT_H_
+#define _LIBC_TYPES_INET_HOSTPORT_H_
 
 #include <inet/addr.h>
Index: uspace/lib/inet/include/types/inetcfg.h
===================================================================
--- uspace/lib/inet/include/types/inetcfg.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/types/inetcfg.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -33,8 +33,7 @@
  */
 
-#ifndef LIBINET_TYPES_INETCFG_H
-#define LIBINET_TYPES_INETCFG_H
+#ifndef _LIBC_TYPES_INETCFG_H_
+#define _LIBC_TYPES_INETCFG_H_
 
-#include <inet/eth_addr.h>
 #include <inet/inet.h>
 #include <stddef.h>
@@ -57,5 +56,5 @@
 	size_t def_mtu;
 	/** Link layer address */
-	eth_addr_t mac_addr;
+	addr48_t mac_addr;
 } inet_link_info_t;
 
Index: uspace/lib/inet/include/types/inetping.h
===================================================================
--- uspace/lib/inet/include/types/inetping.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/include/types/inetping.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -35,6 +35,6 @@
  */
 
-#ifndef LIBINET_TYPES_INETPING_H
-#define LIBINET_TYPES_INETPING_H
+#ifndef _LIBC_TYPES_INETPING_H_
+#define _LIBC_TYPES_INETPING_H_
 
 #include <inet/addr.h>
Index: uspace/lib/inet/meson.build
===================================================================
--- uspace/lib/inet/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -32,5 +32,4 @@
 	'src/dnsr.c',
 	'src/endpoint.c',
-	'src/eth_addr.c',
 	'src/host.c',
 	'src/hostname.c',
@@ -44,7 +43,2 @@
 	'src/udp.c',
 )
-
-test_src = files(
-	'test/eth_addr.c',
-	'test/main.c',
-)
Index: uspace/lib/inet/src/addr.c
===================================================================
--- uspace/lib/inet/src/addr.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/addr.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * Copyright (c) 2013 Martin Decky
  * All rights reserved.
@@ -28,5 +28,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -37,5 +37,4 @@
 #include <errno.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include <stdio.h>
 #include <stddef.h>
@@ -55,6 +54,11 @@
 const addr32_t addr32_broadcast_all_hosts = 0xffffffff;
 
-static eth_addr_t inet_eth_addr_solicited_node =
-    ETH_ADDR_INITIALIZER(0x33, 0x33, 0xff, 0, 0, 0);
+const addr48_t addr48_broadcast = {
+	0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+};
+
+static const addr48_t inet_addr48_solicited_node = {
+	0x33, 0x33, 0xff, 0, 0, 0
+};
 
 static const inet_addr_t inet_addr_any_addr = {
@@ -68,7 +72,21 @@
 };
 
+void addr48(const addr48_t src, addr48_t dst)
+{
+	memcpy(dst, src, 6);
+}
+
 void addr128(const addr128_t src, addr128_t dst)
 {
 	memcpy(dst, src, 16);
+}
+
+/** Compare addr48.
+ *
+ * @return Non-zero if equal, zero if not equal.
+ */
+int addr48_compare(const addr48_t a, const addr48_t b)
+{
+	return memcmp(a, b, 6) == 0;
 }
 
@@ -88,12 +106,8 @@
  *
  */
-void eth_addr_solicited_node(const addr128_t ip, eth_addr_t *mac)
-{
-	uint8_t b[6];
-	mac->a = inet_eth_addr_solicited_node.a;
-
-	eth_addr_encode(&inet_eth_addr_solicited_node, b);
-	memcpy(&b[3], ip + 13, 3);
-	eth_addr_decode(b, mac);
+void addr48_solicited_node(const addr128_t ip, addr48_t mac)
+{
+	memcpy(mac, inet_addr48_solicited_node, 3);
+	memcpy(mac + 3, ip + 13, 3);
 }
 
Index: uspace/lib/inet/src/dhcp.c
===================================================================
--- uspace/lib/inet/src/dhcp.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/dhcp.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/inet/src/endpoint.c
===================================================================
--- uspace/lib/inet/src/endpoint.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/endpoint.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
Index: pace/lib/inet/src/eth_addr.c
===================================================================
--- uspace/lib/inet/src/eth_addr.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,119 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libinet
- * @{
- */
-/**
- * @file
- * @brief
- */
-
-#include <inet/eth_addr.h>
-#include <mem.h>
-#include <stdio.h>
-
-/** Ethernet broadcast address */
-const eth_addr_t eth_addr_broadcast =
-    ETH_ADDR_INITIALIZER(0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
-
-/** Encode Ethernet address to buffer.
- *
- * Encode Ethernet address as a sequence of ETH_ADDR_SIZE bytes into a buffer.
- *
- * @param addr Ethernet address
- * @param buf Buffer (ETH_ADDR_SIZE bytes in size) to store bytes
- */
-void eth_addr_encode(eth_addr_t *addr, uint8_t *buf)
-{
-	uint64_t a;
-	int i;
-
-	a = addr->a;
-
-	for (i = 0; i < ETH_ADDR_SIZE; i++)
-		buf[i] = (a >> (40 - 8 * i)) & 0xff;
-}
-
-/** Decode Ethernet address from buffer.
- *
- * Decode Ethernet address from a buffer containing a sequence of
- * ETH_ADDR_SIZE bytes.
- *
- * @param buf Buffer (ETH_ADDR_SIZE bytes in size)
- * @param addr Place to store Ethernet address
- */
-void eth_addr_decode(const uint8_t *buf, eth_addr_t *addr)
-{
-	uint64_t a;
-	int i;
-
-	a = 0;
-	for (i = 0; i < ETH_ADDR_SIZE; i++)
-		a |= (uint64_t)buf[i] << (40 - 8 * i);
-
-	addr->a = a;
-}
-
-/** Compare Ethernet addresses.
- *
- * @param a First address
- * @param b Second address,
- * @return -1, 0, 1 iff @a a is less than, equal to or greater than @a b,
- *         respectively.
- */
-int eth_addr_compare(const eth_addr_t *a, const eth_addr_t *b)
-{
-	if (a->a < b->a)
-		return -1;
-	else if (a->a == b->a)
-		return 0;
-	else
-		return 1;
-}
-
-/** Format Ethernet address as a string.
- *
- * @param addr Ethernet address
- * @param saddr Structure for storing string representation
- *        of @a addr. The caller can access it as @a saddr->str.
- */
-void eth_addr_format(eth_addr_t *addr, eth_addr_str_t *saddr)
-{
-	int i;
-
-	snprintf(saddr->str, 3, "%02x",
-	    (unsigned)((addr->a >> 40) & 0xff));
-	for (i = 1; i < ETH_ADDR_SIZE; i++) {
-		snprintf(saddr->str + 2 + 3 * (i - 1), 4, ":%02x",
-		    (unsigned)((addr->a >> (40 - i * 8)) & 0xff));
-	}
-}
-
-/** @}
- */
Index: uspace/lib/inet/src/host.c
===================================================================
--- uspace/lib/inet/src/host.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/host.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/inet/src/hostname.c
===================================================================
--- uspace/lib/inet/src/hostname.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/hostname.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/inet/src/hostport.c
===================================================================
--- uspace/lib/inet/src/hostport.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/hostport.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/inet/src/inetcfg.c
===================================================================
--- uspace/lib/inet/src/inetcfg.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/inetcfg.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -30,5 +30,4 @@
 #include <assert.h>
 #include <errno.h>
-#include <inet/eth_addr.h>
 #include <inet/inetcfg.h>
 #include <ipc/inet.h>
@@ -293,5 +292,5 @@
 	aid_t req = async_send_1(exch, INETCFG_LINK_GET, link_id, &answer);
 	aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, &dreply);
-	errno_t rc = async_data_read_start(exch, &linfo->mac_addr, sizeof(eth_addr_t));
+	errno_t rc = async_data_read_start(exch, &linfo->mac_addr, sizeof(addr48_t));
 	async_wait_for(dreq, &dretval);
 
Index: uspace/lib/inet/src/iplink.c
===================================================================
--- uspace/lib/inet/src/iplink.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/iplink.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -38,7 +38,6 @@
 #include <assert.h>
 #include <errno.h>
+#include <inet/iplink.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
-#include <inet/iplink.h>
 #include <ipc/iplink.h>
 #include <ipc/services.h>
@@ -116,5 +115,5 @@
 	aid_t req = async_send_0(exch, IPLINK_SEND6, &answer);
 
-	errno_t rc = async_data_write_start(exch, &sdu->dest, sizeof(eth_addr_t));
+	errno_t rc = async_data_write_start(exch, &sdu->dest, sizeof(addr48_t));
 	if (rc != EOK) {
 		async_exchange_end(exch);
@@ -154,5 +153,5 @@
 }
 
-errno_t iplink_get_mac48(iplink_t *iplink, eth_addr_t *mac)
+errno_t iplink_get_mac48(iplink_t *iplink, addr48_t *mac)
 {
 	async_exch_t *exch = async_exchange_begin(iplink->sess);
@@ -161,5 +160,5 @@
 	aid_t req = async_send_0(exch, IPLINK_GET_MAC48, &answer);
 
-	errno_t rc = async_data_read_start(exch, mac, sizeof(eth_addr_t));
+	errno_t rc = async_data_read_start(exch, mac, sizeof(addr48_t));
 
 	loc_exchange_end(exch);
@@ -176,5 +175,5 @@
 }
 
-errno_t iplink_set_mac48(iplink_t *iplink, eth_addr_t *mac)
+errno_t iplink_set_mac48(iplink_t *iplink, addr48_t mac)
 {
 	async_exch_t *exch = async_exchange_begin(iplink->sess);
@@ -183,5 +182,5 @@
 	aid_t req = async_send_0(exch, IPLINK_GET_MAC48, &answer);
 
-	errno_t rc = async_data_read_start(exch, mac, sizeof(eth_addr_t));
+	errno_t rc = async_data_read_start(exch, mac, sizeof(addr48_t));
 
 	loc_exchange_end(exch);
@@ -265,9 +264,9 @@
 static void iplink_ev_change_addr(iplink_t *iplink, ipc_call_t *icall)
 {
-	eth_addr_t *addr;
+	addr48_t *addr;
 	size_t size;
 
 	errno_t rc = async_data_write_accept((void **) &addr, false,
-	    sizeof(eth_addr_t), sizeof(eth_addr_t), 0, &size);
+	    sizeof(addr48_t), sizeof(addr48_t), 0, &size);
 	if (rc != EOK) {
 		async_answer_0(icall, rc);
@@ -275,5 +274,5 @@
 	}
 
-	rc = iplink->ev_ops->change_addr(iplink, addr);
+	rc = iplink->ev_ops->change_addr(iplink, *addr);
 	free(addr);
 	async_answer_0(icall, EOK);
Index: uspace/lib/inet/src/iplink_srv.c
===================================================================
--- uspace/lib/inet/src/iplink_srv.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/iplink_srv.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
@@ -36,5 +36,4 @@
 
 #include <errno.h>
-#include <inet/eth_addr.h>
 #include <ipc/iplink.h>
 #include <stdlib.h>
@@ -52,5 +51,5 @@
 static void iplink_get_mac48_srv(iplink_srv_t *srv, ipc_call_t *icall)
 {
-	eth_addr_t mac;
+	addr48_t mac;
 	errno_t rc = srv->ops->get_mac48(srv, &mac);
 	if (rc != EOK) {
@@ -67,5 +66,5 @@
 	}
 
-	if (size != sizeof(eth_addr_t)) {
+	if (size != sizeof(addr48_t)) {
 		async_answer_0(&call, EINVAL);
 		async_answer_0(icall, EINVAL);
@@ -84,5 +83,5 @@
 	errno_t rc;
 	size_t size;
-	eth_addr_t mac;
+	addr48_t mac;
 
 	ipc_call_t call;
@@ -98,5 +97,5 @@
 	}
 
-	rc = async_data_read_finalize(&call, &mac, sizeof(eth_addr_t));
+	rc = async_data_read_finalize(&call, &mac, sizeof(addr48_t));
 	if (rc != EOK)
 		async_answer_0(&call, rc);
@@ -190,5 +189,5 @@
 	}
 
-	if (size != sizeof(eth_addr_t)) {
+	if (size != sizeof(addr48_t)) {
 		async_answer_0(&call, EINVAL);
 		async_answer_0(icall, EINVAL);
@@ -323,5 +322,5 @@
 }
 
-errno_t iplink_ev_change_addr(iplink_srv_t *srv, eth_addr_t *addr)
+errno_t iplink_ev_change_addr(iplink_srv_t *srv, addr48_t *addr)
 {
 	if (srv->client_sess == NULL)
@@ -333,5 +332,5 @@
 	aid_t req = async_send_0(exch, IPLINK_EV_CHANGE_ADDR, &answer);
 
-	errno_t rc = async_data_write_start(exch, addr, sizeof(eth_addr_t));
+	errno_t rc = async_data_write_start(exch, addr, sizeof(addr48_t));
 	async_exchange_end(exch);
 
Index: uspace/lib/inet/src/tcp.c
===================================================================
--- uspace/lib/inet/src/tcp.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/tcp.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
Index: uspace/lib/inet/src/udp.c
===================================================================
--- uspace/lib/inet/src/udp.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/inet/src/udp.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libinet
+/** @addtogroup libc
  * @{
  */
Index: pace/lib/inet/test/eth_addr.c
===================================================================
--- uspace/lib/inet/test/eth_addr.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,109 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <errno.h>
-#include <inet/eth_addr.h>
-#include <pcut/pcut.h>
-
-PCUT_INIT;
-
-PCUT_TEST_SUITE(eth_addr);
-
-/** Test ETH_ADDR_INITIALIZER constructs correct Ethernet address */
-PCUT_TEST(initializer)
-{
-	eth_addr_t addr = ETH_ADDR_INITIALIZER(0x11, 0x22, 0x33, 0x44, 0x55,
-	    0x66);
-	PCUT_ASSERT_INT_EQUALS(0x112233445566, addr.a);
-}
-
-/** Test eth_addr_decode() correctly decodes from array of bytes */
-PCUT_TEST(decode)
-{
-	eth_addr_t addr;
-	uint8_t b[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
-
-	eth_addr_decode(b, &addr);
-	PCUT_ASSERT_INT_EQUALS(0x112233445566, addr.a);
-}
-
-/** Test eth_addr_encode() correctly encodes to array of bytes */
-PCUT_TEST(encode)
-{
-	eth_addr_t addr;
-	uint8_t b[7] = { 0, 0, 0, 0, 0, 0, 0 };
-
-	addr.a = 0x112233445566;
-	eth_addr_encode(&addr, b);
-
-	PCUT_ASSERT_INT_EQUALS(0x11, b[0]);
-	PCUT_ASSERT_INT_EQUALS(0x22, b[1]);
-	PCUT_ASSERT_INT_EQUALS(0x33, b[2]);
-	PCUT_ASSERT_INT_EQUALS(0x44, b[3]);
-	PCUT_ASSERT_INT_EQUALS(0x55, b[4]);
-	PCUT_ASSERT_INT_EQUALS(0x66, b[5]);
-}
-
-/** Test eth_addr_compare() correctly compares two Ethernet addresses */
-PCUT_TEST(compare)
-{
-	eth_addr_t a;
-	eth_addr_t b;
-
-	a.a = 1;
-	b.a = 2;
-	PCUT_ASSERT_INT_EQUALS(-1, eth_addr_compare(&a, &b));
-
-	a.a = 2;
-	b.a = 2;
-	PCUT_ASSERT_INT_EQUALS(0, eth_addr_compare(&a, &b));
-
-	a.a = 2;
-	b.a = 1;
-	PCUT_ASSERT_INT_EQUALS(1, eth_addr_compare(&a, &b));
-}
-
-/** Tets eth_addr_format() correctly formats Ethernet address to string */
-PCUT_TEST(format)
-{
-	eth_addr_t addr1 = ETH_ADDR_INITIALIZER(0x11, 0x22, 0x33, 0x44, 0x55, 0x66);
-	eth_addr_t addr2 = ETH_ADDR_INITIALIZER(0x01, 0x02, 0x03, 0x04, 0x05, 0x06);
-	eth_addr_t addr3 = ETH_ADDR_INITIALIZER(0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
-	eth_addr_str_t saddr;
-
-	eth_addr_format(&addr1, &saddr);
-	PCUT_ASSERT_STR_EQUALS("11:22:33:44:55:66", saddr.str);
-
-	eth_addr_format(&addr2, &saddr);
-	PCUT_ASSERT_STR_EQUALS("01:02:03:04:05:06", saddr.str);
-
-	eth_addr_format(&addr3, &saddr);
-	PCUT_ASSERT_STR_EQUALS("aa:bb:cc:dd:ee:ff", saddr.str);
-}
-
-PCUT_EXPORT(eth_addr);
Index: pace/lib/inet/test/main.c
===================================================================
--- uspace/lib/inet/test/main.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,35 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <pcut/pcut.h>
-
-PCUT_INIT;
-
-PCUT_IMPORT(eth_addr);
-
-PCUT_MAIN();
Index: uspace/lib/memgfx/include/memgfx/memgc.h
===================================================================
--- uspace/lib/memgfx/include/memgfx/memgc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/memgfx/include/memgfx/memgc.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -46,5 +46,5 @@
 
 extern errno_t mem_gc_create(gfx_rect_t *, gfx_bitmap_alloc_t *,
-    mem_gc_cb_t *, void *, mem_gc_t **);
+    mem_gc_invalidate_cb_t, mem_gc_update_cb_t, void *, mem_gc_t **);
 extern errno_t mem_gc_delete(mem_gc_t *);
 extern void mem_gc_retarget(mem_gc_t *, gfx_rect_t *, gfx_bitmap_alloc_t *);
Index: pace/lib/memgfx/include/memgfx/xlategc.h
===================================================================
--- uspace/lib/memgfx/include/memgfx/xlategc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libmemgfx
- * @{
- */
-/**
- * @file Translating graphics context
- */
-
-#ifndef _MEMGFX_XLATEGC_H
-#define _MEMGFX_XLATEGC_H
-
-#include <errno.h>
-#include <gfx/context.h>
-#include <gfx/coord.h>
-#include <types/memgfx/xlategc.h>
-
-extern gfx_context_ops_t xlate_gc_ops;
-
-extern errno_t xlate_gc_create(gfx_coord2_t *, gfx_context_t *, xlate_gc_t **);
-extern errno_t xlate_gc_delete(xlate_gc_t *);
-extern gfx_context_t *xlate_gc_get_ctx(xlate_gc_t *);
-extern void xlate_gc_set_off(xlate_gc_t *, gfx_coord2_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/memgfx/include/types/memgfx/memgc.h
===================================================================
--- uspace/lib/memgfx/include/types/memgfx/memgc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/memgfx/include/types/memgfx/memgc.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -37,6 +37,4 @@
 #define _MEMGFX_TYPES_MEMGC_H
 
-#include <errno.h>
-#include <stdbool.h>
 #include <types/gfx/coord.h>
 
@@ -44,16 +42,6 @@
 typedef struct mem_gc mem_gc_t;
 
-typedef struct {
-	/** Invalidate rectangle */
-	void (*invalidate)(void *, gfx_rect_t *);
-	/** Update display */
-	void (*update)(void *);
-	/** Get cursor position */
-	errno_t (*cursor_get_pos)(void *, gfx_coord2_t *);
-	/** Set cursor position */
-	errno_t (*cursor_set_pos)(void *, gfx_coord2_t *);
-	/** Set cursor visibility */
-	errno_t (*cursor_set_visible)(void *, bool);
-} mem_gc_cb_t;
+typedef void (*mem_gc_invalidate_cb_t)(void *, gfx_rect_t *);
+typedef void (*mem_gc_update_cb_t)(void *);
 
 #endif
Index: pace/lib/memgfx/include/types/memgfx/xlategc.h
===================================================================
--- uspace/lib/memgfx/include/types/memgfx/xlategc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libmemgfx
- * @{
- */
-/**
- * @file Translating grapics context
- */
-
-#ifndef _MEMGFX_TYPES_XLATEGC_H
-#define _MEMGFX_TYPES_XLATEGC_H
-
-struct xlate_gc;
-typedef struct xlate_gc xlate_gc_t;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/memgfx/meson.build
===================================================================
--- uspace/lib/memgfx/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/memgfx/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 #
-# Copyright (c) 2021 Jiri Svoboda
+# Copyright (c) 2020 Jiri Svoboda
 # All rights reserved.
 #
@@ -29,6 +29,5 @@
 deps = [ 'gfx' ]
 src = files(
-	'src/memgc.c',
-	'src/xlategc.c'
+	'src/memgc.c'
 )
 
@@ -36,4 +35,3 @@
 	'test/main.c',
 	'test/memgfx.c',
-	'test/xlategc.c'
 )
Index: uspace/lib/memgfx/private/memgc.h
===================================================================
--- uspace/lib/memgfx/private/memgc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/memgfx/private/memgc.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libmemgfx
+/** @addtogroup libguigfx
  * @{
  */
@@ -53,7 +53,9 @@
 	/** Allocation info */
 	gfx_bitmap_alloc_t alloc;
-	/** Callbacks */
-	mem_gc_cb_t *cb;
-	/** Argument to callbacks */
+	/** Invalidate callback */
+	mem_gc_invalidate_cb_t invalidate;
+	/** Update callback */
+	mem_gc_update_cb_t update;
+	/** Argument to callback */
 	void *cb_arg;
 	/** Current drawing color */
@@ -63,5 +65,5 @@
 /** Bitmap in memory GC */
 typedef struct {
-	/** Containing memory GC */
+	/** Containing canvas GC */
 	struct mem_gc *mgc;
 	/** Allocation info */
Index: pace/lib/memgfx/private/xlategc.h
===================================================================
--- uspace/lib/memgfx/private/xlategc.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libmemgfx
- * @{
- */
-/**
- * @file Translating graphics context structure
- *
- */
-
-#ifndef _MEMGFX_PRIVATE_XLATEGC_H
-#define _MEMGFX_PRIVATE_XLATEGC_H
-
-#include <gfx/bitmap.h>
-#include <gfx/context.h>
-#include <gfx/coord.h>
-#include <io/pixel.h>
-
-/** Actual structure of translating GC. */
-struct xlate_gc {
-	/** Graphic context */
-	gfx_context_t *gc;
-	/** Backing graphic context */
-	gfx_context_t *bgc;
-	/** Translation offset */
-	gfx_coord2_t off;
-};
-
-/** Bitmap in translating GC */
-typedef struct {
-	/** Containing translating GC */
-	struct xlate_gc *xgc;
-	/** Base bitmap in base GC */
-	gfx_bitmap_t *bm;
-} xlate_gc_bitmap_t;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/memgfx/src/memgc.c
===================================================================
--- uspace/lib/memgfx/src/memgc.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/memgfx/src/memgc.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -57,7 +57,4 @@
 static errno_t mem_gc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
 static errno_t mem_gc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
-static errno_t mem_gc_cursor_get_pos(void *, gfx_coord2_t *);
-static errno_t mem_gc_cursor_set_pos(void *, gfx_coord2_t *);
-static errno_t mem_gc_cursor_set_visible(void *, bool);
 static void mem_gc_invalidate_rect(mem_gc_t *, gfx_rect_t *);
 
@@ -70,8 +67,5 @@
 	.bitmap_destroy = mem_gc_bitmap_destroy,
 	.bitmap_render = mem_gc_bitmap_render,
-	.bitmap_get_alloc = mem_gc_bitmap_get_alloc,
-	.cursor_get_pos = mem_gc_cursor_get_pos,
-	.cursor_set_pos = mem_gc_cursor_set_pos,
-	.cursor_set_visible = mem_gc_cursor_set_visible
+	.bitmap_get_alloc = mem_gc_bitmap_get_alloc
 };
 
@@ -108,9 +102,7 @@
 	mem_gc_t *mgc = (mem_gc_t *) arg;
 	uint16_t r, g, b;
-	uint8_t attr;
 
 	gfx_color_get_rgb_i16(color, &r, &g, &b);
-	gfx_color_get_ega(color, &attr);
-	mgc->color = PIXEL(attr, r >> 8, g >> 8, b >> 8);
+	mgc->color = PIXEL(0, r >> 8, g >> 8, b >> 8);
 	return EOK;
 }
@@ -160,5 +152,5 @@
 	mem_gc_t *mgc = (mem_gc_t *) arg;
 
-	mgc->cb->update(mgc->cb_arg);
+	mgc->update(mgc->cb_arg);
 	return EOK;
 }
@@ -170,6 +162,6 @@
  * @param rect Bounding rectangle
  * @param alloc Allocation info
- * @param cb Pointer to memory GC callbacks
- * @param cb_arg Argument to callback functions
+ * @param update_cb Function called to update a rectangle
+ * @param cb_arg Argument to callback function
  * @param rgc Place to store pointer to new memory GC
  *
@@ -177,5 +169,6 @@
  */
 errno_t mem_gc_create(gfx_rect_t *rect, gfx_bitmap_alloc_t *alloc,
-    mem_gc_cb_t *cb, void *cb_arg, mem_gc_t **rgc)
+    mem_gc_invalidate_cb_t invalidate_cb, mem_gc_update_cb_t update_cb,
+    void *cb_arg, mem_gc_t **rgc)
 {
 	mem_gc_t *mgc = NULL;
@@ -198,5 +191,6 @@
 	mgc->alloc = *alloc;
 
-	mgc->cb = cb;
+	mgc->invalidate = invalidate_cb;
+	mgc->update = update_cb;
 	mgc->cb_arg = cb_arg;
 
@@ -252,5 +246,5 @@
 static void mem_gc_invalidate_rect(mem_gc_t *mgc, gfx_rect_t *rect)
 {
-	mgc->cb->invalidate(mgc->cb_arg, rect);
+	mgc->invalidate(mgc->cb_arg, rect);
 }
 
@@ -470,55 +464,4 @@
 }
 
-/** Get cursor position on memory GC.
- *
- * @param arg Memory GC
- * @param pos Place to store position
- *
- * @return EOK on success or an error code
- */
-static errno_t mem_gc_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	mem_gc_t *mgc = (mem_gc_t *) arg;
-
-	if (mgc->cb->cursor_get_pos != NULL)
-		return mgc->cb->cursor_get_pos(mgc->cb_arg, pos);
-	else
-		return ENOTSUP;
-}
-
-/** Set cursor position on memory GC.
- *
- * @param arg Memory GC
- * @param pos New position
- *
- * @return EOK on success or an error code
- */
-static errno_t mem_gc_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	mem_gc_t *mgc = (mem_gc_t *) arg;
-
-	if (mgc->cb->cursor_set_pos != NULL)
-		return mgc->cb->cursor_set_pos(mgc->cb_arg, pos);
-	else
-		return ENOTSUP;
-}
-
-/** Set cursor visibility on memory GC.
- *
- * @param arg Memory GC
- * @param visible @c true iff cursor should be made visible
- *
- * @return EOK on success or an error code
- */
-static errno_t mem_gc_cursor_set_visible(void *arg, bool visible)
-{
-	mem_gc_t *mgc = (mem_gc_t *) arg;
-
-	if (mgc->cb->cursor_set_visible != NULL)
-		return mgc->cb->cursor_set_visible(mgc->cb_arg, visible);
-	else
-		return ENOTSUP;
-}
-
 /** @}
  */
Index: pace/lib/memgfx/src/xlategc.c
===================================================================
--- uspace/lib/memgfx/src/xlategc.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,349 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libmemgfx
- * @{
- */
-/**
- * @file Translating graphics context
- *
- * A graphics context that just forwards all operations to another graphics
- * context with an offset.
- */
-
-#include <assert.h>
-#include <gfx/color.h>
-#include <gfx/context.h>
-#include <gfx/cursor.h>
-#include <gfx/render.h>
-#include <memgfx/xlategc.h>
-#include <stdlib.h>
-#include "../private/xlategc.h"
-
-static errno_t xlate_gc_set_clip_rect(void *, gfx_rect_t *);
-static errno_t xlate_gc_set_color(void *, gfx_color_t *);
-static errno_t xlate_gc_fill_rect(void *, gfx_rect_t *);
-static errno_t xlate_gc_update(void *);
-static errno_t xlate_gc_bitmap_create(void *, gfx_bitmap_params_t *,
-    gfx_bitmap_alloc_t *, void **);
-static errno_t xlate_gc_bitmap_destroy(void *);
-static errno_t xlate_gc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
-static errno_t xlate_gc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
-static errno_t xlate_gc_cursor_get_pos(void *, gfx_coord2_t *);
-static errno_t xlate_gc_cursor_set_pos(void *, gfx_coord2_t *);
-static errno_t xlate_gc_cursor_set_visible(void *, bool);
-
-gfx_context_ops_t xlate_gc_ops = {
-	.set_clip_rect = xlate_gc_set_clip_rect,
-	.set_color = xlate_gc_set_color,
-	.fill_rect = xlate_gc_fill_rect,
-	.update = xlate_gc_update,
-	.bitmap_create = xlate_gc_bitmap_create,
-	.bitmap_destroy = xlate_gc_bitmap_destroy,
-	.bitmap_render = xlate_gc_bitmap_render,
-	.bitmap_get_alloc = xlate_gc_bitmap_get_alloc,
-	.cursor_get_pos = xlate_gc_cursor_get_pos,
-	.cursor_set_pos = xlate_gc_cursor_set_pos,
-	.cursor_set_visible = xlate_gc_cursor_set_visible
-};
-
-/** Set clipping rectangle on translating GC.
- *
- * @param arg Translating GC
- * @param rect Rectangle
- *
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_set_clip_rect(void *arg, gfx_rect_t *rect)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-	gfx_rect_t crect;
-
-	if (rect != NULL) {
-		gfx_rect_translate(&xgc->off, rect, &crect);
-		return gfx_set_clip_rect(xgc->bgc, &crect);
-	} else {
-		return gfx_set_clip_rect(xgc->bgc, NULL);
-	}
-}
-
-/** Set color on translating GC.
- *
- * Set drawing color on translating GC.
- *
- * @param arg Translating GC
- * @param color Color
- *
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_set_color(void *arg, gfx_color_t *color)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-
-	return gfx_set_color(xgc->bgc, color);
-}
-
-/** Fill rectangle on translating GC.
- *
- * @param arg Translating GC
- * @param rect Rectangle
- *
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_fill_rect(void *arg, gfx_rect_t *rect)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-	gfx_rect_t frect;
-
-	gfx_rect_translate(&xgc->off, rect, &frect);
-	return gfx_fill_rect(xgc->bgc, &frect);
-}
-
-/** Update translating GC.
- *
- * @param arg Translating GC
- *
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_update(void *arg)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-
-	return gfx_update(xgc->bgc);
-}
-
-/** Create translating GC.
- *
- * Create graphics context that renders into another GC with offset.
- *
- * @param off Offset
- * @param bgc Backing GC
- * @param rgc Place to store pointer to new translating GC
- *
- * @return EOK on success or an error code
- */
-errno_t xlate_gc_create(gfx_coord2_t *off, gfx_context_t *bgc,
-    xlate_gc_t **rgc)
-{
-	xlate_gc_t *xgc = NULL;
-	gfx_context_t *gc = NULL;
-	errno_t rc;
-
-	xgc = calloc(1, sizeof(xlate_gc_t));
-	if (xgc == NULL) {
-		rc = ENOMEM;
-		goto error;
-	}
-
-	rc = gfx_context_new(&xlate_gc_ops, xgc, &gc);
-	if (rc != EOK)
-		goto error;
-
-	xgc->bgc = bgc;
-	xgc->gc = gc;
-	xgc->off = *off;
-
-	*rgc = xgc;
-	return EOK;
-error:
-	if (xgc != NULL)
-		free(xgc);
-	gfx_context_delete(gc);
-	return rc;
-}
-
-/** Delete translating GC.
- *
- * @param xgc Translating GC
- */
-errno_t xlate_gc_delete(xlate_gc_t *xgc)
-{
-	errno_t rc;
-
-	rc = gfx_context_delete(xgc->gc);
-	if (rc != EOK)
-		return rc;
-
-	free(xgc);
-	return EOK;
-}
-
-/** Get generic graphic context from translating GC.
- *
- * @param xgc Translating GC
- * @return Graphic context
- */
-gfx_context_t *xlate_gc_get_ctx(xlate_gc_t *xgc)
-{
-	return xgc->gc;
-}
-
-/** Create bitmap in translating GC.
- *
- * @param arg Translating GC
- * @param params Bitmap params
- * @param alloc Bitmap allocation info or @c NULL
- * @param rbm Place to store pointer to new bitmap
- * @return EOK on success or an error code
- */
-errno_t xlate_gc_bitmap_create(void *arg, gfx_bitmap_params_t *params,
-    gfx_bitmap_alloc_t *alloc, void **rbm)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-	xlate_gc_bitmap_t *xbm;
-	gfx_bitmap_t *bm = NULL;
-	errno_t rc;
-
-	xbm = calloc(1, sizeof(xlate_gc_bitmap_t));
-	if (xbm == NULL)
-		return ENOMEM;
-
-	rc = gfx_bitmap_create(xgc->bgc, params, alloc, &bm);
-	if (rc != EOK) {
-		free(xbm);
-		return rc;
-	}
-
-	xbm->xgc = xgc;
-	xbm->bm = bm;
-
-	*rbm = (void *)xbm;
-	return EOK;
-}
-
-/** Destroy bitmap in translating GC.
- *
- * @param bm Bitmap
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_bitmap_destroy(void *bm)
-{
-	xlate_gc_bitmap_t *xbm = (xlate_gc_bitmap_t *)bm;
-	errno_t rc;
-
-	rc = gfx_bitmap_destroy(xbm->bm);
-	free(xbm);
-	return rc;
-}
-
-/** Render bitmap in translating GC.
- *
- * @param bm Bitmap
- * @param srect0 Source rectangle or @c NULL
- * @param offs0 Offset or @c NULL
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_bitmap_render(void *bm, gfx_rect_t *srect0,
-    gfx_coord2_t *offs0)
-{
-	xlate_gc_bitmap_t *xbm = (xlate_gc_bitmap_t *)bm;
-	gfx_coord2_t offs;
-
-	if (offs0 != NULL)
-		gfx_coord2_add(offs0, &xbm->xgc->off, &offs);
-	else
-		offs = xbm->xgc->off;
-
-	return gfx_bitmap_render(xbm->bm, srect0, &offs);
-}
-
-/** Get allocation info for bitmap in translating GC.
- *
- * @param bm Bitmap
- * @param alloc Place to store allocation info
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_bitmap_get_alloc(void *bm, gfx_bitmap_alloc_t *alloc)
-{
-	xlate_gc_bitmap_t *xbm = (xlate_gc_bitmap_t *)bm;
-	return gfx_bitmap_get_alloc(xbm->bm, alloc);
-}
-
-/** Get cursor position on translating GC.
- *
- * @param arg Translating GC
- * @param pos Place to store position
- *
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-	gfx_coord2_t cpos;
-	errno_t rc;
-
-	rc = gfx_cursor_get_pos(xgc->bgc, &cpos);
-	if (rc != EOK)
-		return rc;
-
-	gfx_coord2_subtract(&cpos, &xgc->off, pos);
-	return EOK;
-}
-
-/** Set cursor position on translating GC.
- *
- * @param arg Translating GC
- * @param pos New position
- *
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-	gfx_coord2_t cpos;
-
-	gfx_coord2_add(pos, &xgc->off, &cpos);
-	return gfx_cursor_set_pos(xgc->bgc, &cpos);
-}
-
-/** Set cursor visibility on translating GC.
- *
- * @param arg Translating GC
- * @param visible @c true iff cursor should be made visible
- *
- * @return EOK on success or an error code
- */
-static errno_t xlate_gc_cursor_set_visible(void *arg, bool visible)
-{
-	xlate_gc_t *xgc = (xlate_gc_t *) arg;
-
-	return gfx_cursor_set_visible(xgc->bgc, visible);
-}
-
-/** Set translation offset on translating GC.
- *
- * @param xgc Translating GC
- * @param off Offset
- */
-void xlate_gc_set_off(xlate_gc_t *xgc, gfx_coord2_t *off)
-{
-	xgc->off = *off;
-}
-
-/** @}
- */
Index: uspace/lib/memgfx/test/main.c
===================================================================
--- uspace/lib/memgfx/test/main.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/memgfx/test/main.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -32,5 +32,4 @@
 
 PCUT_IMPORT(memgfx);
-PCUT_IMPORT(xlategc);
 
 PCUT_MAIN();
Index: uspace/lib/memgfx/test/memgfx.c
===================================================================
--- uspace/lib/memgfx/test/memgfx.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/memgfx/test/memgfx.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -32,5 +32,4 @@
 #include <gfx/coord.h>
 #include <gfx/context.h>
-#include <gfx/cursor.h>
 #include <gfx/render.h>
 #include <io/pixelmap.h>
@@ -45,19 +44,6 @@
 static void test_invalidate_rect(void *arg, gfx_rect_t *rect);
 static void test_update(void *arg);
-static errno_t test_cursor_get_pos(void *arg, gfx_coord2_t *);
-static errno_t test_cursor_set_pos(void *arg, gfx_coord2_t *);
-static errno_t test_cursor_set_visible(void *arg, bool);
-
-static mem_gc_cb_t test_mem_gc_cb = {
-	.invalidate = test_invalidate_rect,
-	.update = test_update,
-	.cursor_get_pos = test_cursor_get_pos,
-	.cursor_set_pos = test_cursor_set_pos,
-	.cursor_set_visible = test_cursor_set_visible
-};
 
 typedef struct {
-	/** Return code to return */
-	errno_t rc;
 	/** True if invalidate was called */
 	bool invalidate_called;
@@ -66,16 +52,4 @@
 	/** True if update was called */
 	bool update_called;
-	/** True if cursor_get_pos was called */
-	bool cursor_get_pos_called;
-	/** Position to return from cursor_get_pos */
-	gfx_coord2_t get_pos_pos;
-	/** True if cursor_set_pos was called */
-	bool cursor_set_pos_called;
-	/** Position passed to cursor_set_pos */
-	gfx_coord2_t set_pos_pos;
-	/** True if cursor_set_visible was called */
-	bool cursor_set_visible_called;
-	/** Value passed to cursor_set_visible */
-	bool set_visible_vis;
 } test_resp_t;
 
@@ -98,5 +72,5 @@
 	PCUT_ASSERT_NOT_NULL(alloc.pixels);
 
-	rc = mem_gc_create(&rect, &alloc, NULL, NULL, &mgc);
+	rc = mem_gc_create(&rect, &alloc, NULL, NULL, NULL, &mgc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -132,5 +106,6 @@
 	PCUT_ASSERT_NOT_NULL(alloc.pixels);
 
-	rc = mem_gc_create(&rect, &alloc, &test_mem_gc_cb, &resp, &mgc);
+	rc = mem_gc_create(&rect, &alloc, test_invalidate_rect,
+	    test_update, &resp, &mgc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -212,5 +187,6 @@
 	PCUT_ASSERT_NOT_NULL(alloc.pixels);
 
-	rc = mem_gc_create(&rect, &alloc, &test_mem_gc_cb, &resp, &mgc);
+	rc = mem_gc_create(&rect, &alloc, test_invalidate_rect,
+	    test_update, &resp, &mgc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -301,5 +277,6 @@
 	PCUT_ASSERT_NOT_NULL(alloc.pixels);
 
-	rc = mem_gc_create(&rect, &alloc, &test_mem_gc_cb, &resp, &mgc);
+	rc = mem_gc_create(&rect, &alloc, test_invalidate_rect,
+	    test_update, &resp, &mgc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -317,135 +294,4 @@
 }
 
-/** Test gfx_cursor_get_pos() on a memory GC */
-PCUT_TEST(gfx_cursor_get_pos)
-{
-	mem_gc_t *mgc;
-	gfx_rect_t rect;
-	gfx_bitmap_alloc_t alloc;
-	gfx_coord2_t pos;
-	gfx_context_t *gc;
-	test_resp_t resp;
-	errno_t rc;
-
-	/* Bounding rectangle for memory GC */
-	rect.p0.x = 0;
-	rect.p0.y = 0;
-	rect.p1.x = 10;
-	rect.p1.y = 10;
-
-	alloc.pitch = (rect.p1.x - rect.p0.x) * sizeof(uint32_t);
-	alloc.off0 = 0;
-	alloc.pixels = calloc(1, alloc.pitch * (rect.p1.y - rect.p0.y));
-	PCUT_ASSERT_NOT_NULL(alloc.pixels);
-
-	rc = mem_gc_create(&rect, &alloc, &test_mem_gc_cb, &resp, &mgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gc = mem_gc_get_ctx(mgc);
-	PCUT_ASSERT_NOT_NULL(gc);
-
-	memset(&resp, 0, sizeof(resp));
-	resp.rc = EOK;
-	resp.get_pos_pos.x = 1;
-	resp.get_pos_pos.y = 2;
-	PCUT_ASSERT_FALSE(resp.cursor_get_pos_called);
-
-	rc = gfx_cursor_get_pos(gc, &pos);
-	PCUT_ASSERT_TRUE(resp.cursor_get_pos_called);
-	PCUT_ASSERT_INT_EQUALS(resp.get_pos_pos.x, pos.x);
-	PCUT_ASSERT_INT_EQUALS(resp.get_pos_pos.y, pos.y);
-
-	mem_gc_delete(mgc);
-	free(alloc.pixels);
-}
-
-/** Test gfx_cursor_set_pos() on a memory GC */
-PCUT_TEST(gfx_cursor_set_pos)
-{
-	mem_gc_t *mgc;
-	gfx_rect_t rect;
-	gfx_bitmap_alloc_t alloc;
-	gfx_coord2_t pos;
-	gfx_context_t *gc;
-	test_resp_t resp;
-	errno_t rc;
-
-	/* Bounding rectangle for memory GC */
-	rect.p0.x = 0;
-	rect.p0.y = 0;
-	rect.p1.x = 10;
-	rect.p1.y = 10;
-
-	alloc.pitch = (rect.p1.x - rect.p0.x) * sizeof(uint32_t);
-	alloc.off0 = 0;
-	alloc.pixels = calloc(1, alloc.pitch * (rect.p1.y - rect.p0.y));
-	PCUT_ASSERT_NOT_NULL(alloc.pixels);
-
-	rc = mem_gc_create(&rect, &alloc, &test_mem_gc_cb, &resp, &mgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gc = mem_gc_get_ctx(mgc);
-	PCUT_ASSERT_NOT_NULL(gc);
-
-	memset(&resp, 0, sizeof(resp));
-	resp.rc = EOK;
-	pos.x = 1;
-	pos.y = 2;
-	PCUT_ASSERT_FALSE(resp.cursor_set_pos_called);
-
-	rc = gfx_cursor_set_pos(gc, &pos);
-	PCUT_ASSERT_TRUE(resp.cursor_set_pos_called);
-	PCUT_ASSERT_INT_EQUALS(pos.x, resp.set_pos_pos.x);
-	PCUT_ASSERT_INT_EQUALS(pos.y, resp.set_pos_pos.y);
-
-	mem_gc_delete(mgc);
-	free(alloc.pixels);
-}
-
-/** Test gfx_cursor_set_visible() on a memory GC */
-PCUT_TEST(gfx_cursor_set_visible)
-{
-	mem_gc_t *mgc;
-	gfx_rect_t rect;
-	gfx_bitmap_alloc_t alloc;
-	gfx_context_t *gc;
-	test_resp_t resp;
-	errno_t rc;
-
-	/* Bounding rectangle for memory GC */
-	rect.p0.x = 0;
-	rect.p0.y = 0;
-	rect.p1.x = 10;
-	rect.p1.y = 10;
-
-	alloc.pitch = (rect.p1.x - rect.p0.x) * sizeof(uint32_t);
-	alloc.off0 = 0;
-	alloc.pixels = calloc(1, alloc.pitch * (rect.p1.y - rect.p0.y));
-	PCUT_ASSERT_NOT_NULL(alloc.pixels);
-
-	rc = mem_gc_create(&rect, &alloc, &test_mem_gc_cb, &resp, &mgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gc = mem_gc_get_ctx(mgc);
-	PCUT_ASSERT_NOT_NULL(gc);
-
-	memset(&resp, 0, sizeof(resp));
-	resp.rc = EOK;
-	PCUT_ASSERT_FALSE(resp.cursor_set_visible_called);
-
-	rc = gfx_cursor_set_visible(gc, true);
-	PCUT_ASSERT_TRUE(resp.cursor_set_visible_called);
-	PCUT_ASSERT_TRUE(resp.set_visible_vis);
-
-	resp.cursor_set_visible_called = false;
-
-	rc = gfx_cursor_set_visible(gc, false);
-	PCUT_ASSERT_TRUE(resp.cursor_set_visible_called);
-	PCUT_ASSERT_FALSE(resp.set_visible_vis);
-
-	mem_gc_delete(mgc);
-	free(alloc.pixels);
-}
-
 /** Called by memory GC when a rectangle is modified. */
 static void test_invalidate_rect(void *arg, gfx_rect_t *rect)
@@ -465,33 +311,3 @@
 }
 
-/** Called by memory GC when cursor_get_pos is called. */
-static errno_t test_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	test_resp_t *resp = (test_resp_t *)arg;
-
-	resp->cursor_get_pos_called = true;
-	*pos = resp->get_pos_pos;
-	return resp->rc;
-}
-
-/** Called by memory GC when cursor_set_pos is called. */
-static errno_t test_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	test_resp_t *resp = (test_resp_t *)arg;
-
-	resp->cursor_set_pos_called = true;
-	resp->set_pos_pos = *pos;
-	return resp->rc;
-}
-
-/** Called by memory GC when cursor_set_visible is called. */
-static errno_t test_cursor_set_visible(void *arg, bool visible)
-{
-	test_resp_t *resp = (test_resp_t *)arg;
-
-	resp->cursor_set_visible_called = true;
-	resp->set_visible_vis = visible;
-	return resp->rc;
-}
-
 PCUT_EXPORT(memgfx);
Index: pace/lib/memgfx/test/xlategc.c
===================================================================
--- uspace/lib/memgfx/test/xlategc.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,916 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <errno.h>
-#include <gfx/bitmap.h>
-#include <gfx/color.h>
-#include <gfx/coord.h>
-#include <gfx/context.h>
-#include <gfx/cursor.h>
-#include <gfx/render.h>
-#include <mem.h>
-#include <memgfx/xlategc.h>
-#include <pcut/pcut.h>
-
-PCUT_INIT;
-
-PCUT_TEST_SUITE(xlategc);
-
-static errno_t testgc_set_clip_rect(void *, gfx_rect_t *);
-static errno_t testgc_set_color(void *, gfx_color_t *);
-static errno_t testgc_fill_rect(void *, gfx_rect_t *);
-static errno_t testgc_update(void *);
-static errno_t testgc_bitmap_create(void *, gfx_bitmap_params_t *,
-    gfx_bitmap_alloc_t *, void **);
-static errno_t testgc_bitmap_destroy(void *);
-static errno_t testgc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
-static errno_t testgc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
-static errno_t testgc_cursor_get_pos(void *, gfx_coord2_t *);
-static errno_t testgc_cursor_set_pos(void *, gfx_coord2_t *);
-static errno_t testgc_cursor_set_visible(void *, bool);
-
-static gfx_context_ops_t testgc_ops = {
-	.set_clip_rect = testgc_set_clip_rect,
-	.set_color = testgc_set_color,
-	.fill_rect = testgc_fill_rect,
-	.update = testgc_update,
-	.bitmap_create = testgc_bitmap_create,
-	.bitmap_destroy = testgc_bitmap_destroy,
-	.bitmap_render = testgc_bitmap_render,
-	.bitmap_get_alloc = testgc_bitmap_get_alloc,
-	.cursor_get_pos = testgc_cursor_get_pos,
-	.cursor_set_pos = testgc_cursor_set_pos,
-	.cursor_set_visible = testgc_cursor_set_visible
-};
-
-typedef struct {
-	/** Return code to return */
-	errno_t rc;
-	/** True if set_clip_rect was called */
-	bool set_clip_rect_called;
-	/** Argument to set_clip_rect */
-	gfx_rect_t set_clip_rect_rect;
-	/** True if set_color was called */
-	bool set_color_called;
-	/** Argument to set_color (red) */
-	uint16_t set_color_r;
-	/** Argument to set_color (green) */
-	uint16_t set_color_g;
-	/** Argument to set_color (blue) */
-	uint16_t set_color_b;
-	/** True if fill_rect was called */
-	bool fill_rect_called;
-	/** Argument to fill_rect */
-	gfx_rect_t fill_rect_rect;
-	/** True if bitmap_create was called */
-	bool bitmap_create_called;
-	/** Bitmap parameters passed to bitmap_create */
-	gfx_bitmap_params_t bitmap_create_params;
-	/** Allocation info passed to bitmap_create */
-	gfx_bitmap_alloc_t bitmap_create_alloc;
-	/** Cookie to store in the created bitmap */
-	uint32_t bitmap_create_cookie;
-	/** True if bitmap_destroy was called */
-	bool bitmap_destroy_called;
-	/** Cookie retrieved from bitmap by bitmap_destroy */
-	uint32_t bitmap_destroy_cookie;
-	/** True if bitmap_render was called */
-	bool bitmap_render_called;
-	/** Source rectangle passed to bitmap_render */
-	gfx_rect_t bitmap_render_srect;
-	/** Offset passed to bitmap_render */
-	gfx_coord2_t bitmap_render_off;
-	/** Cookie retrieved from bitmap by bitmap_render */
-	uint32_t bitmap_render_cookie;
-	/** True if bitmap_get_alloc was called */
-	bool bitmap_get_alloc_called;
-	/** Cookie retrieved from bitmap by bitmap_get_alloc */
-	uint32_t bitmap_get_alloc_cookie;
-	/** Allocation info to return from bitmap_get_alloc */
-	gfx_bitmap_alloc_t bitmap_get_alloc_alloc;
-	/** True if update was called */
-	bool update_called;
-	/** True if cursor_get_pos was called */
-	bool cursor_get_pos_called;
-	/** Position to return from cursor_get_pos */
-	gfx_coord2_t cursor_get_pos_pos;
-	/** True if cursor_set_pos was called */
-	bool cursor_set_pos_called;
-	/** Position passed to cursor_set_pos */
-	gfx_coord2_t cursor_set_pos_pos;
-	/** True if cursor_set_visible was called */
-	bool cursor_set_visible_called;
-	/** Value passed to cursor_set_visible */
-	bool cursor_set_visible_vis;
-} test_gc_t;
-
-typedef struct {
-	test_gc_t *gc;
-	/** Cookie passed around for verification */
-	uint32_t cookie;
-} test_gc_bitmap_t;
-
-/** Test creating and deleting a translation GC */
-PCUT_TEST(create_delete)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_coord2_t off;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test setting a clipping rectangle in translation GC */
-PCUT_TEST(set_clip_rect)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_rect_t rect;
-	gfx_coord2_t off;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	rect.p0.x = 1;
-	rect.p0.y = 2;
-	rect.p1.x = 3;
-	rect.p1.y = 4;
-
-	test_gc.rc = EOK;
-	rc = gfx_set_clip_rect(xgc, &rect);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(test_gc.set_clip_rect_called);
-	PCUT_ASSERT_INT_EQUALS(11, test_gc.set_clip_rect_rect.p0.x);
-	PCUT_ASSERT_INT_EQUALS(22, test_gc.set_clip_rect_rect.p0.y);
-	PCUT_ASSERT_INT_EQUALS(13, test_gc.set_clip_rect_rect.p1.x);
-	PCUT_ASSERT_INT_EQUALS(24, test_gc.set_clip_rect_rect.p1.y);
-
-	test_gc.rc = EIO;
-	rc = gfx_set_clip_rect(xgc, &rect);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test setting color in translation GC */
-PCUT_TEST(set_color)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_color_t *color;
-	gfx_coord2_t off;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	rc = gfx_color_new_rgb_i16(1, 2, 3, &color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	test_gc.rc = EOK;
-	rc = gfx_set_color(xgc, color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(test_gc.set_color_called);
-	PCUT_ASSERT_INT_EQUALS(1, test_gc.set_color_r);
-	PCUT_ASSERT_INT_EQUALS(2, test_gc.set_color_g);
-	PCUT_ASSERT_INT_EQUALS(3, test_gc.set_color_b);
-
-	test_gc.rc = EIO;
-	rc = gfx_set_color(xgc, color);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test filling a rectangle in translation GC */
-PCUT_TEST(fill_rect)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_rect_t rect;
-	gfx_coord2_t off;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	rect.p0.x = 1;
-	rect.p0.y = 2;
-	rect.p1.x = 3;
-	rect.p1.y = 4;
-
-	test_gc.rc = EOK;
-	rc = gfx_fill_rect(xgc, &rect);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(test_gc.fill_rect_called);
-	PCUT_ASSERT_INT_EQUALS(11, test_gc.fill_rect_rect.p0.x);
-	PCUT_ASSERT_INT_EQUALS(22, test_gc.fill_rect_rect.p0.y);
-	PCUT_ASSERT_INT_EQUALS(13, test_gc.fill_rect_rect.p1.x);
-	PCUT_ASSERT_INT_EQUALS(24, test_gc.fill_rect_rect.p1.y);
-
-	test_gc.rc = EIO;
-	rc = gfx_fill_rect(xgc, &rect);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test updating a translation GC */
-PCUT_TEST(update)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_rect_t rect;
-	gfx_coord2_t off;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	rect.p0.x = 1;
-	rect.p0.y = 2;
-	rect.p1.x = 3;
-	rect.p1.y = 4;
-
-	test_gc.rc = EOK;
-	rc = gfx_set_clip_rect(xgc, &rect);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(test_gc.set_clip_rect_called);
-	PCUT_ASSERT_INT_EQUALS(11, test_gc.set_clip_rect_rect.p0.x);
-	PCUT_ASSERT_INT_EQUALS(22, test_gc.set_clip_rect_rect.p0.y);
-	PCUT_ASSERT_INT_EQUALS(13, test_gc.set_clip_rect_rect.p1.x);
-	PCUT_ASSERT_INT_EQUALS(24, test_gc.set_clip_rect_rect.p1.y);
-
-	test_gc.rc = EIO;
-	rc = gfx_set_clip_rect(xgc, &rect);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test creating bitmap in translating GC */
-PCUT_TEST(bitmap_create)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_bitmap_params_t params;
-	gfx_bitmap_alloc_t alloc;
-	gfx_coord2_t off;
-	gfx_bitmap_t *bitmap;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-	gfx_bitmap_params_init(&params);
-	params.rect.p0.x = 1;
-	params.rect.p0.y = 2;
-	params.rect.p1.x = 3;
-	params.rect.p1.y = 4;
-	params.flags = bmpf_direct_output;
-	params.key_color = 0x112233;
-
-	test_gc.rc = EOK;
-	rc = gfx_bitmap_create(xgc, &params, &alloc, &bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_TRUE(test_gc.bitmap_create_called);
-	PCUT_ASSERT_INT_EQUALS(1, test_gc.bitmap_create_params.rect.p0.x);
-	PCUT_ASSERT_INT_EQUALS(2, test_gc.bitmap_create_params.rect.p0.y);
-	PCUT_ASSERT_INT_EQUALS(3, test_gc.bitmap_create_params.rect.p1.x);
-	PCUT_ASSERT_INT_EQUALS(4, test_gc.bitmap_create_params.rect.p1.y);
-
-	test_gc.rc = EOK;
-	gfx_bitmap_destroy(bitmap);
-
-	test_gc.rc = EIO;
-	rc = gfx_bitmap_create(xgc, &params, &alloc, &bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test destroying bitmap in translating GC */
-PCUT_TEST(bitmap_destroy)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_bitmap_params_t params;
-	gfx_bitmap_alloc_t alloc;
-	gfx_coord2_t off;
-	gfx_bitmap_t *bitmap;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-	gfx_bitmap_params_init(&params);
-	params.rect.p0.x = 1;
-	params.rect.p0.y = 2;
-	params.rect.p1.x = 3;
-	params.rect.p1.y = 4;
-	params.flags = bmpf_direct_output;
-	params.key_color = 0x112233;
-
-	test_gc.rc = EOK;
-	test_gc.bitmap_create_cookie = 0x12345678;
-	rc = gfx_bitmap_create(xgc, &params, &alloc, &bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_INT_EQUALS(1, test_gc.bitmap_create_params.rect.p0.x);
-	PCUT_ASSERT_INT_EQUALS(2, test_gc.bitmap_create_params.rect.p0.y);
-	PCUT_ASSERT_INT_EQUALS(3, test_gc.bitmap_create_params.rect.p1.x);
-	PCUT_ASSERT_INT_EQUALS(4, test_gc.bitmap_create_params.rect.p1.y);
-	PCUT_ASSERT_INT_EQUALS(bmpf_direct_output,
-	    test_gc.bitmap_create_params.flags);
-	PCUT_ASSERT_INT_EQUALS(0x112233,
-	    test_gc.bitmap_create_params.key_color);
-
-	test_gc.rc = EOK;
-	rc = gfx_bitmap_destroy(bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_TRUE(test_gc.bitmap_destroy_called);
-	PCUT_ASSERT_INT_EQUALS(0x12345678, test_gc.bitmap_destroy_cookie);
-
-	test_gc.rc = EOK;
-	rc = gfx_bitmap_create(xgc, &params, &alloc, &bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	test_gc.rc = EIO;
-	rc = gfx_bitmap_destroy(bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test rendering bitmap in translation GC */
-PCUT_TEST(bitmap_render)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_bitmap_params_t params;
-	gfx_bitmap_alloc_t alloc;
-	gfx_rect_t srect;
-	gfx_coord2_t off;
-	gfx_bitmap_t *bitmap;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-	gfx_bitmap_params_init(&params);
-	params.rect.p0.x = 1;
-	params.rect.p0.y = 2;
-	params.rect.p1.x = 3;
-	params.rect.p1.y = 4;
-
-	test_gc.rc = EOK;
-	test_gc.bitmap_create_cookie = 0x12345678;
-	rc = gfx_bitmap_create(xgc, &params, &alloc, &bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	srect.p0.x = 5;
-	srect.p0.y = 6;
-	srect.p1.x = 7;
-	srect.p1.y = 8;
-
-	off.x = 100;
-	off.y = 200;
-
-	test_gc.rc = EOK;
-	rc = gfx_bitmap_render(bitmap, &srect, &off);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_TRUE(test_gc.bitmap_render_called);
-	PCUT_ASSERT_INT_EQUALS(0x12345678, test_gc.bitmap_render_cookie);
-	PCUT_ASSERT_INT_EQUALS(5, test_gc.bitmap_render_srect.p0.x);
-	PCUT_ASSERT_INT_EQUALS(6, test_gc.bitmap_render_srect.p0.y);
-	PCUT_ASSERT_INT_EQUALS(7, test_gc.bitmap_render_srect.p1.x);
-	PCUT_ASSERT_INT_EQUALS(8, test_gc.bitmap_render_srect.p1.y);
-	PCUT_ASSERT_INT_EQUALS(110, test_gc.bitmap_render_off.x);
-	PCUT_ASSERT_INT_EQUALS(220, test_gc.bitmap_render_off.y);
-
-	test_gc.rc = EIO;
-	rc = gfx_bitmap_render(bitmap, &srect, &off);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	test_gc.rc = EOK;
-	rc = gfx_bitmap_destroy(bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test getting bitmap allocation info in translation GC */
-PCUT_TEST(bitmap_get_alloc)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_bitmap_params_t params;
-	gfx_bitmap_alloc_t alloc;
-	gfx_bitmap_alloc_t galloc;
-	gfx_coord2_t off;
-	gfx_bitmap_t *bitmap;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-	gfx_bitmap_params_init(&params);
-	params.rect.p0.x = 1;
-	params.rect.p0.y = 2;
-	params.rect.p1.x = 3;
-	params.rect.p1.y = 4;
-
-	test_gc.rc = EOK;
-	test_gc.bitmap_create_cookie = 0x12345678;
-	rc = gfx_bitmap_create(xgc, &params, &alloc, &bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	test_gc.bitmap_get_alloc_alloc.pitch = 42;
-	test_gc.bitmap_get_alloc_alloc.off0 = 43;
-	test_gc.bitmap_get_alloc_alloc.pixels = malloc(1);
-	PCUT_ASSERT_NOT_NULL(test_gc.bitmap_get_alloc_alloc.pixels);
-
-	test_gc.rc = EOK;
-	rc = gfx_bitmap_get_alloc(bitmap, &galloc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_TRUE(test_gc.bitmap_get_alloc_called);
-	PCUT_ASSERT_INT_EQUALS(42, galloc.pitch);
-	PCUT_ASSERT_INT_EQUALS(43, galloc.off0);
-	PCUT_ASSERT_EQUALS(test_gc.bitmap_get_alloc_alloc.pixels, galloc.pixels);
-
-	test_gc.rc = EIO;
-	rc = gfx_bitmap_get_alloc(bitmap, &galloc);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-
-	test_gc.rc = EOK;
-	rc = gfx_bitmap_destroy(bitmap);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	free(test_gc.bitmap_get_alloc_alloc.pixels);
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test getting cursor position in translation GC */
-PCUT_TEST(cursor_get_pos)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_coord2_t off;
-	gfx_coord2_t gpos;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	test_gc.cursor_get_pos_pos.x = 13;
-	test_gc.cursor_get_pos_pos.y = 24;
-	test_gc.rc = EOK;
-	rc = gfx_cursor_get_pos(xgc, &gpos);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_TRUE(test_gc.cursor_get_pos_called);
-
-	/*
-	 * Note that translation GC performs inverse translation when getting
-	 * cursor coordinates.
-	 */
-	PCUT_ASSERT_INT_EQUALS(3, gpos.x);
-	PCUT_ASSERT_INT_EQUALS(4, gpos.y);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test setting cursor position in translation GC */
-PCUT_TEST(cursor_set_pos)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_coord2_t off;
-	gfx_coord2_t pos;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	pos.x = 3;
-	pos.y = 4;
-
-	test_gc.rc = EOK;
-	rc = gfx_cursor_set_pos(xgc, &pos);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_TRUE(test_gc.cursor_set_pos_called);
-	PCUT_ASSERT_INT_EQUALS(13, test_gc.cursor_set_pos_pos.x);
-	PCUT_ASSERT_INT_EQUALS(24, test_gc.cursor_set_pos_pos.y);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Test setting cursor visibility in translation GC */
-PCUT_TEST(cursor_set_visible)
-{
-	test_gc_t test_gc;
-	gfx_context_t *tgc;
-	xlate_gc_t *xlategc;
-	gfx_context_t *xgc;
-	gfx_coord2_t off;
-	errno_t rc;
-
-	rc = gfx_context_new(&testgc_ops, &test_gc, &tgc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	off.x = 10;
-	off.y = 20;
-	rc = xlate_gc_create(&off, tgc, &xlategc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	xgc = xlate_gc_get_ctx(xlategc);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	test_gc.rc = EOK;
-	rc = gfx_cursor_set_visible(xgc, true);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_TRUE(test_gc.cursor_set_visible_called);
-	PCUT_ASSERT_TRUE(test_gc.cursor_set_visible_vis);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	test_gc.rc = EOK;
-	rc = gfx_cursor_set_visible(xgc, false);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_TRUE(test_gc.cursor_set_visible_called);
-	PCUT_ASSERT_FALSE(test_gc.cursor_set_visible_vis);
-
-	memset(&test_gc, 0, sizeof(test_gc));
-
-	test_gc.rc = EIO;
-	rc = gfx_cursor_set_visible(xgc, false);
-	PCUT_ASSERT_ERRNO_VAL(EIO, rc);
-	PCUT_ASSERT_TRUE(test_gc.cursor_set_visible_called);
-	PCUT_ASSERT_FALSE(test_gc.cursor_set_visible_vis);
-
-	xlate_gc_delete(xlategc);
-	gfx_context_delete(tgc);
-}
-
-/** Set clipping rectangle in test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @param rect Rectangle
- * @return EOK on success or an error code
- */
-static errno_t testgc_set_clip_rect(void *arg, gfx_rect_t *rect)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-
-	test_gc->set_clip_rect_called = true;
-	test_gc->set_clip_rect_rect = *rect;
-
-	return test_gc->rc;
-}
-
-/** Set drawing color in test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @param color Color
- * @return EOK on success or an error code
- */
-static errno_t testgc_set_color(void *arg, gfx_color_t *color)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-
-	test_gc->set_color_called = true;
-	gfx_color_get_rgb_i16(color, &test_gc->set_color_r,
-	    &test_gc->set_color_g, &test_gc->set_color_b);
-
-	return test_gc->rc;
-}
-
-/** Fill rectangle in test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @param rect Rectangle
- * @return EOK on success or an error code
- */
-static errno_t testgc_fill_rect(void *arg, gfx_rect_t *rect)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-
-	test_gc->fill_rect_called = true;
-	test_gc->fill_rect_rect = *rect;
-
-	return test_gc->rc;
-}
-
-/** Update test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @return EOK on success or an error code
- */
-static errno_t testgc_update(void *arg)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-
-	test_gc->update_called = true;
-	return test_gc->rc;
-}
-
-/** Create bitmap in test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @param params Bitmap parameters
- * @param alloc Bitmap allocation info or @c NULL
- * @param rbitmap Place to store pointer to new bitmap
- * @return EOK on success or an error code
- */
-static errno_t testgc_bitmap_create(void *arg, gfx_bitmap_params_t *params,
-    gfx_bitmap_alloc_t *alloc, void **rbitmap)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-	test_gc_bitmap_t *tbitmap;
-
-	test_gc->bitmap_create_called = true;
-	if (params != NULL)
-		test_gc->bitmap_create_params = *params;
-	if (alloc != NULL)
-		test_gc->bitmap_create_alloc = *alloc;
-
-	if (test_gc->rc != EOK)
-		return test_gc->rc;
-
-	tbitmap = calloc(1, sizeof(test_gc_bitmap_t));
-	if (tbitmap == NULL)
-		return ENOMEM;
-
-	tbitmap->gc = test_gc;
-	tbitmap->cookie = test_gc->bitmap_create_cookie;
-	*rbitmap = (void *)tbitmap;
-	return EOK;
-}
-
-/** Destroy bitmap in test GC.
- *
- * @param bitmap Bitmap
- * @return EOK on success or an error code
- */
-static errno_t testgc_bitmap_destroy(void *bitmap)
-{
-	test_gc_bitmap_t *tbitmap = (test_gc_bitmap_t *)bitmap;
-	test_gc_t *test_gc = tbitmap->gc;
-
-	test_gc->bitmap_destroy_called = true;
-	test_gc->bitmap_destroy_cookie = tbitmap->cookie;
-	return test_gc->rc;
-}
-
-/** Render bitmap in test GC.
- *
- * @param arg Bitmap
- * @param srect Source rectangle (or @c NULL)
- * @param off Offset (or @c NULL)
- * @return EOK on success or an error code
- */
-static errno_t testgc_bitmap_render(void *bitmap, gfx_rect_t *srect,
-    gfx_coord2_t *off)
-{
-	test_gc_bitmap_t *tbitmap = (test_gc_bitmap_t *)bitmap;
-	test_gc_t *test_gc = tbitmap->gc;
-
-	test_gc->bitmap_render_called = true;
-	test_gc->bitmap_render_cookie = tbitmap->cookie;
-	if (srect != NULL)
-		test_gc->bitmap_render_srect = *srect;
-	if (off != NULL)
-		test_gc->bitmap_render_off = *off;
-	return test_gc->rc;
-}
-
-/** Get bitmap allocation info in test GC.
- *
- * @param bitmap Bitmap
- * @param alloc Place to store allocation info
- * @return EOK on success or an error code
- */
-static errno_t testgc_bitmap_get_alloc(void *bitmap, gfx_bitmap_alloc_t *alloc)
-{
-	test_gc_bitmap_t *tbitmap = (test_gc_bitmap_t *)bitmap;
-	test_gc_t *test_gc = tbitmap->gc;
-
-	test_gc->bitmap_get_alloc_called = true;
-	test_gc->bitmap_get_alloc_cookie = tbitmap->cookie;
-
-	if (test_gc->rc != EOK)
-		return test_gc->rc;
-
-	*alloc = test_gc->bitmap_get_alloc_alloc;
-	return EOK;
-}
-
-/** Get cursor position in test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @param pos Place to store cursor position
- * @return EOK on success or an error code
- */
-static errno_t testgc_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-
-	test_gc->cursor_get_pos_called = true;
-
-	if (test_gc->rc != EOK)
-		return test_gc->rc;
-
-	*pos = test_gc->cursor_get_pos_pos;
-	return EOK;
-}
-
-/** Set cursor position in test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @param pos Cursor position
- * @return EOK on success or an error code
- */
-static errno_t testgc_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-
-	test_gc->cursor_set_pos_called = true;
-	test_gc->cursor_set_pos_pos = *pos;
-
-	return test_gc->rc;
-}
-
-/** Set cursor visibility in test GC.
- *
- * @param arg Argument (test_gc_t *)
- * @param visible @c true iff cursor should be visible
- * @return EOK on success or an error code
- */
-static errno_t testgc_cursor_set_visible(void *arg, bool visible)
-{
-	test_gc_t *test_gc = (test_gc_t *)arg;
-
-	test_gc->cursor_set_visible_called = true;
-	test_gc->cursor_set_visible_vis = visible;
-
-	return test_gc->rc;
-}
-
-PCUT_EXPORT(xlategc);
Index: uspace/lib/meson.build
===================================================================
--- uspace/lib/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -57,5 +57,4 @@
 	'block',
 	'clui',
-	'codepage',
 	'compress',
 	'cpp',
Index: uspace/lib/ui/include/types/ui/control.h
===================================================================
--- uspace/lib/ui/include/types/ui/control.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/types/ui/control.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,5 +38,4 @@
 
 #include <errno.h>
-#include <io/kbd_event.h>
 #include <io/pos_event.h>
 #include <types/ui/event.h>
@@ -51,6 +50,4 @@
 	/** Paint */
 	errno_t (*paint)(void *);
-	/** Keyboard event */
-	ui_evclaim_t (*kbd_event)(void *, kbd_event_t *);
 	/** Position event */
 	ui_evclaim_t (*pos_event)(void *, pos_event_t *);
Index: pace/lib/ui/include/types/ui/filedialog.h
===================================================================
--- uspace/lib/ui/include/types/ui/filedialog.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file File dialog
- */
-
-#ifndef _UI_TYPES_FILEDIALOG_H
-#define _UI_TYPES_FILEDIALOG_H
-
-#include <errno.h>
-#include <io/kbd_event.h>
-#include <io/pos_event.h>
-#include <types/ui/wdecor.h>
-
-struct ui_file_dialog;
-typedef struct ui_file_dialog ui_file_dialog_t;
-
-/** File dialog parameters */
-typedef struct {
-	/** Window caption */
-	const char *caption;
-	/** Initial file name */
-	const char *ifname;
-} ui_file_dialog_params_t;
-
-/** File dialog callback */
-typedef struct ui_file_dialog_cb {
-	/** OK button was pressed */
-	void (*bok)(ui_file_dialog_t *, void *, const char *);
-	/** Cancel button was pressed */
-	void (*bcancel)(ui_file_dialog_t *, void *);
-	/** Window closure requested (e.g. via close button) */
-	void (*close)(ui_file_dialog_t *, void *);
-} ui_file_dialog_cb_t;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/ui/include/types/ui/paint.h
===================================================================
--- uspace/lib/ui/include/types/ui/paint.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/types/ui/paint.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -49,36 +49,4 @@
 } ui_fcircle_part_t;
 
-/** Box characters for a particular box style.
- *
- * The first coordinate selects top, center, bottom,
- * the second coordinate selects left, center, right.
- * The top/bottom, left/right characters correpsond to corners,
- * the characters with one center coordinate correspond to edges:
- *
- *    0   1   2
- * 0 '+' '-' '+'
- * 1 ' |' ' ' '|'
- * 2 '+' '-' '+'
- *
- */
-typedef struct {
-	const char *c[3][3];
-} ui_box_chars_t;
-
-/** Horizontal brace characters for a particular box style. */
-typedef struct {
-	const char *start;
-	const char *middle;
-	const char *end;
-} ui_brace_chars_t;
-
-/** Box style */
-typedef enum {
-	/** Single box */
-	ui_box_single,
-	/** Double box */
-	ui_box_double
-} ui_box_style_t;
-
 #endif
 
Index: pace/lib/ui/include/types/ui/promptdialog.h
===================================================================
--- uspace/lib/ui/include/types/ui/promptdialog.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,70 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file Prompt dialog
- */
-
-#ifndef _UI_TYPES_PROMPTDIALOG_H
-#define _UI_TYPES_PROMPTDIALOG_H
-
-#include <errno.h>
-#include <io/kbd_event.h>
-#include <io/pos_event.h>
-#include <types/ui/wdecor.h>
-
-struct ui_prompt_dialog;
-typedef struct ui_prompt_dialog ui_prompt_dialog_t;
-
-/** Prompt dialog parameters */
-typedef struct {
-	/** Window caption */
-	const char *caption;
-	/** Prompt text */
-	const char *prompt;
-	/** Initial entry text */
-	const char *itext;
-} ui_prompt_dialog_params_t;
-
-/** Prompt dialog callback */
-typedef struct ui_prompt_dialog_cb {
-	/** OK button was pressed */
-	void (*bok)(ui_prompt_dialog_t *, void *, const char *);
-	/** Cancel button was pressed */
-	void (*bcancel)(ui_prompt_dialog_t *, void *);
-	/** Window closure requested (e.g. via close button) */
-	void (*close)(ui_prompt_dialog_t *, void *);
-} ui_prompt_dialog_cb_t;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/ui/include/types/ui/ui.h
===================================================================
--- uspace/lib/ui/include/types/ui/ui.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/types/ui/ui.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -42,10 +42,6 @@
 typedef struct ui ui_t;
 
-/** Use the default display service (argument to ui_create()) */
+/** Use the default display service (argument to ui_create() */
 #define UI_DISPLAY_DEFAULT NULL
-/** Use the default console service (argument to ui_create()) */
-#define UI_CONSOLE_DEFAULT "cons@"
-/** Use dummy output (argument to ui_create()) */
-#define UI_DISPLAY_NULL "null@"
 
 /** Window system */
@@ -56,7 +52,5 @@
 	ui_ws_display,
 	/** Console */
-	ui_ws_console,
-	/** Dummy output */
-	ui_ws_null
+	ui_ws_console
 } ui_winsys_t;
 
Index: uspace/lib/ui/include/ui/control.h
===================================================================
--- uspace/lib/ui/include/ui/control.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/control.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,5 +38,4 @@
 
 #include <errno.h>
-#include <io/kbd_event.h>
 #include <io/pos_event.h>
 #include <types/ui/control.h>
@@ -47,5 +46,4 @@
 extern void ui_control_destroy(ui_control_t *);
 extern errno_t ui_control_paint(ui_control_t *);
-extern ui_evclaim_t ui_control_kbd_event(ui_control_t *, kbd_event_t *);
 extern ui_evclaim_t ui_control_pos_event(ui_control_t *, pos_event_t *);
 extern void ui_control_unfocus(ui_control_t *);
Index: uspace/lib/ui/include/ui/entry.h
===================================================================
--- uspace/lib/ui/include/ui/entry.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/entry.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -50,21 +50,6 @@
 extern void ui_entry_set_rect(ui_entry_t *, gfx_rect_t *);
 extern void ui_entry_set_halign(ui_entry_t *, gfx_halign_t);
-extern void ui_entry_set_read_only(ui_entry_t *, bool);
 extern errno_t ui_entry_set_text(ui_entry_t *, const char *);
-extern const char *ui_entry_get_text(ui_entry_t *);
 extern errno_t ui_entry_paint(ui_entry_t *);
-extern void ui_entry_activate(ui_entry_t *);
-extern void ui_entry_deactivate(ui_entry_t *);
-extern void ui_entry_backspace(ui_entry_t *);
-extern void ui_entry_delete(ui_entry_t *);
-extern void ui_entry_copy(ui_entry_t *);
-extern void ui_entry_cut(ui_entry_t *);
-extern void ui_entry_paste(ui_entry_t *);
-extern void ui_entry_seek_start(ui_entry_t *, bool);
-extern void ui_entry_seek_end(ui_entry_t *, bool);
-extern void ui_entry_seek_prev_char(ui_entry_t *, bool);
-extern void ui_entry_seek_next_char(ui_entry_t *, bool);
-extern ui_evclaim_t ui_entry_kbd_event(ui_entry_t *, kbd_event_t *);
-extern ui_evclaim_t ui_entry_pos_event(ui_entry_t *, pos_event_t *);
 
 #endif
Index: pace/lib/ui/include/ui/filedialog.h
===================================================================
--- uspace/lib/ui/include/ui/filedialog.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file File dialog
- */
-
-#ifndef _UI_FILEDIALOG_H
-#define _UI_FILEDIALOG_H
-
-#include <errno.h>
-#include <types/ui/filedialog.h>
-#include <types/ui/ui.h>
-
-extern void ui_file_dialog_params_init(ui_file_dialog_params_t *);
-extern errno_t ui_file_dialog_create(ui_t *, ui_file_dialog_params_t *,
-    ui_file_dialog_t **);
-extern void ui_file_dialog_set_cb(ui_file_dialog_t *, ui_file_dialog_cb_t *,
-    void *);
-extern void ui_file_dialog_destroy(ui_file_dialog_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/ui/include/ui/fixed.h
===================================================================
--- uspace/lib/ui/include/ui/fixed.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/fixed.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -49,5 +49,4 @@
 extern void ui_fixed_remove(ui_fixed_t *, ui_control_t *);
 extern errno_t ui_fixed_paint(ui_fixed_t *);
-extern ui_evclaim_t ui_fixed_kbd_event(ui_fixed_t *, kbd_event_t *);
 extern ui_evclaim_t ui_fixed_pos_event(ui_fixed_t *, pos_event_t *);
 extern void ui_fixed_unfocus(ui_fixed_t *);
Index: uspace/lib/ui/include/ui/label.h
===================================================================
--- uspace/lib/ui/include/ui/label.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/label.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -50,5 +50,4 @@
 extern void ui_label_set_rect(ui_label_t *, gfx_rect_t *);
 extern void ui_label_set_halign(ui_label_t *, gfx_halign_t);
-extern void ui_label_set_valign(ui_label_t *, gfx_valign_t);
 extern errno_t ui_label_set_text(ui_label_t *, const char *);
 extern errno_t ui_label_paint(ui_label_t *);
Index: uspace/lib/ui/include/ui/msgdialog.h
===================================================================
--- uspace/lib/ui/include/ui/msgdialog.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/msgdialog.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -31,9 +31,9 @@
  */
 /**
- * @file Message dialog
+ * @file Message Dialog
  */
 
-#ifndef _UI_MSGDIALOG_H
-#define _UI_MSGDIALOG_H
+#ifndef _UI_MSG_DIALOG_H
+#define _UI_MSG_DIALOG_H
 
 #include <errno.h>
Index: uspace/lib/ui/include/ui/paint.h
===================================================================
--- uspace/lib/ui/include/ui/paint.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/paint.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -45,9 +45,5 @@
 extern errno_t ui_paint_bevel(gfx_context_t *, gfx_rect_t *, gfx_color_t *,
     gfx_color_t *, gfx_coord_t, gfx_rect_t *);
-extern void ui_paint_get_bevel_inside(gfx_context_t *, gfx_rect_t *,
-    gfx_coord_t, gfx_rect_t *);
 extern errno_t ui_paint_inset_frame(ui_resource_t *, gfx_rect_t *,
-    gfx_rect_t *);
-extern void ui_paint_get_inset_frame_inside(ui_resource_t *, gfx_rect_t *,
     gfx_rect_t *);
 extern errno_t ui_paint_outset_frame(ui_resource_t *, gfx_rect_t *,
@@ -55,8 +51,4 @@
 extern errno_t ui_paint_filled_circle(gfx_context_t *, gfx_coord2_t *,
     gfx_coord_t, ui_fcircle_part_t);
-extern errno_t ui_paint_text_box(ui_resource_t *, gfx_rect_t *,
-    ui_box_style_t, gfx_color_t *);
-extern errno_t ui_paint_text_hbrace(ui_resource_t *, gfx_rect_t *,
-    ui_box_style_t, gfx_color_t *);
 
 #endif
Index: pace/lib/ui/include/ui/promptdialog.h
===================================================================
--- uspace/lib/ui/include/ui/promptdialog.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file Prompt dialog
- */
-
-#ifndef _UI_PROMPTDIALOG_H
-#define _UI_PROMPTDIALOG_H
-
-#include <errno.h>
-#include <types/ui/promptdialog.h>
-#include <types/ui/ui.h>
-
-extern void ui_prompt_dialog_params_init(ui_prompt_dialog_params_t *);
-extern errno_t ui_prompt_dialog_create(ui_t *, ui_prompt_dialog_params_t *,
-    ui_prompt_dialog_t **);
-extern void ui_prompt_dialog_set_cb(ui_prompt_dialog_t *, ui_prompt_dialog_cb_t *,
-    void *);
-extern void ui_prompt_dialog_destroy(ui_prompt_dialog_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/ui/include/ui/rbutton.h
===================================================================
--- uspace/lib/ui/include/ui/rbutton.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/rbutton.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -61,5 +61,4 @@
 extern void ui_rbutton_enter(ui_rbutton_t *);
 extern void ui_rbutton_leave(ui_rbutton_t *);
-extern void ui_rbutton_select(ui_rbutton_t *);
 extern void ui_rbutton_selected(ui_rbutton_t *);
 extern ui_evclaim_t ui_rbutton_pos_event(ui_rbutton_t *, pos_event_t *);
Index: uspace/lib/ui/include/ui/resource.h
===================================================================
--- uspace/lib/ui/include/ui/resource.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/resource.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -39,5 +39,4 @@
 #include <errno.h>
 #include <gfx/context.h>
-#include <gfx/font.h>
 #include <stdbool.h>
 #include <types/ui/resource.h>
@@ -48,5 +47,4 @@
     void *);
 extern void ui_resource_expose(ui_resource_t *);
-extern gfx_font_t *ui_resource_get_font(ui_resource_t *);
 
 #endif
Index: uspace/lib/ui/include/ui/window.h
===================================================================
--- uspace/lib/ui/include/ui/window.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/include/ui/window.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -40,5 +40,4 @@
 #include <gfx/context.h>
 #include <gfx/coord.h>
-#include <io/kbd_event.h>
 #include <io/pos_event.h>
 #include <types/ui/control.h>
@@ -56,5 +55,4 @@
 extern ui_window_t *ui_window_get_active(ui_t *);
 extern errno_t ui_window_resize(ui_window_t *, gfx_rect_t *);
-extern ui_t *ui_window_get_ui(ui_window_t *);
 extern ui_resource_t *ui_window_get_res(ui_window_t *);
 extern gfx_context_t *ui_window_get_gc(ui_window_t *);
@@ -64,5 +62,4 @@
 extern void ui_window_set_ctl_cursor(ui_window_t *, ui_stock_cursor_t);
 extern errno_t ui_window_paint(ui_window_t *);
-extern void ui_window_def_kbd(ui_window_t *, kbd_event_t *);
 extern errno_t ui_window_def_paint(ui_window_t *);
 extern void ui_window_def_pos(ui_window_t *, pos_event_t *);
Index: uspace/lib/ui/meson.build
===================================================================
--- uspace/lib/ui/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -33,5 +33,4 @@
 	'src/dummygc.c',
 	'src/entry.c',
-	'src/filedialog.c',
 	'src/fixed.c',
 	'src/image.c',
@@ -44,5 +43,4 @@
 	'src/pbutton.c',
 	'src/popup.c',
-	'src/promptdialog.c',
 	'src/rbutton.c',
 	'src/resource.c',
@@ -57,5 +55,4 @@
 	'test/control.c',
 	'test/entry.c',
-	'test/filedialog.c',
 	'test/fixed.c',
 	'test/image.c',
@@ -69,5 +66,4 @@
 	'test/pbutton.c',
 	'test/popup.c',
-	'test/promptdialog.c',
 	'test/rbutton.c',
 	'test/resource.c',
Index: uspace/lib/ui/private/checkbox.h
===================================================================
--- uspace/lib/ui/private/checkbox.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/checkbox.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -66,7 +66,4 @@
 };
 
-extern errno_t ui_checkbox_paint_gfx(ui_checkbox_t *);
-extern errno_t ui_checkbox_paint_text(ui_checkbox_t *);
-
 #endif
 
Index: uspace/lib/ui/private/entry.h
===================================================================
--- uspace/lib/ui/private/entry.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/entry.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -40,5 +40,4 @@
 #include <gfx/coord.h>
 #include <gfx/text.h>
-#include <stdbool.h>
 
 /** Actual structure of text entry.
@@ -55,49 +54,9 @@
 	/** Horizontal alignment */
 	gfx_halign_t halign;
-	/** Text entry is read-only */
-	bool read_only;
 	/** Text */
 	char *text;
-	/** Current scroll position (in pixels) */
-	gfx_coord_t scroll_pos;
-	/** Cursor position in the text (offset in bytes) */
-	unsigned pos;
-	/** Selection start position in text (offset in bytes) */
-	unsigned sel_start;
 	/** Pointer is currently inside */
 	bool pointer_inside;
-	/** Entry is activated */
-	bool active;
-	/** Button is held down */
-	bool held;
-	/** Left shift is held down */
-	bool lshift_held;
-	/** Right shift is held down */
-	bool rshift_held;
 };
-
-/** Text entry geometry.
- *
- * Computed geometry of text entry elements.
- */
-typedef struct {
-	/** Interior rectangle */
-	gfx_rect_t interior_rect;
-	/** Text rectangle */
-	gfx_rect_t text_rect;
-	/** Text anchor position */
-	gfx_coord2_t text_pos;
-	/** Text anchor X coordinate */
-	gfx_coord_t anchor_x;
-} ui_entry_geom_t;
-
-extern errno_t ui_entry_insert_str(ui_entry_t *, const char *);
-extern ui_evclaim_t ui_entry_key_press_ctrl(ui_entry_t *, kbd_event_t *);
-extern ui_evclaim_t ui_entry_key_press_shift(ui_entry_t *, kbd_event_t *);
-extern ui_evclaim_t ui_entry_key_press_unmod(ui_entry_t *, kbd_event_t *);
-extern void ui_entry_get_geom(ui_entry_t *, ui_entry_geom_t *);
-extern size_t ui_entry_find_pos(ui_entry_t *, gfx_coord2_t *);
-extern void ui_entry_delete_sel(ui_entry_t *);
-extern void ui_entry_scroll_update(ui_entry_t *, bool);
 
 #endif
Index: pace/lib/ui/private/filedialog.h
===================================================================
--- uspace/lib/ui/private/filedialog.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file File dialog structure
- *
- */
-
-#ifndef _UI_PRIVATE_FILEDIALOG_H
-#define _UI_PRIVATE_FILEDIALOG_H
-
-/** Actual structure of file dialog.
- *
- * This is private to libui.
- */
-struct ui_file_dialog {
-	/** Dialog window */
-	struct ui_window *window;
-	/** File name entry */
-	struct ui_entry *ename;
-	/** OK button */
-	struct ui_pbutton *bok;
-	/** Cancel button */
-	struct ui_pbutton *bcancel;
-	/** File dialog callbacks */
-	struct ui_file_dialog_cb *cb;
-	/** Callback argument */
-	void *arg;
-};
-
-#endif
-
-/** @}
- */
Index: uspace/lib/ui/private/label.h
===================================================================
--- uspace/lib/ui/private/label.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/label.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -54,6 +54,4 @@
 	/** Horizontal alignment */
 	gfx_halign_t halign;
-	/** Vertical alignment */
-	gfx_valign_t valign;
 	/** Text */
 	char *text;
Index: uspace/lib/ui/private/menu.h
===================================================================
--- uspace/lib/ui/private/menu.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/menu.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -82,6 +82,4 @@
 extern void ui_menu_get_geom(ui_menu_t *, gfx_coord2_t *, ui_menu_geom_t *);
 extern ui_resource_t *ui_menu_get_res(ui_menu_t *);
-extern errno_t ui_menu_paint_bg_gfx(ui_menu_t *, gfx_coord2_t *);
-extern errno_t ui_menu_paint_bg_text(ui_menu_t *, gfx_coord2_t *);
 
 #endif
Index: pace/lib/ui/private/promptdialog.h
===================================================================
--- uspace/lib/ui/private/promptdialog.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file Prompt dialog structure
- *
- */
-
-#ifndef _UI_PRIVATE_PROMPTDIALOG_H
-#define _UI_PRIVATE_PROMPTDIALOG_H
-
-/** Actual structure of prompt dialog.
- *
- * This is private to libui.
- */
-struct ui_prompt_dialog {
-	/** Dialog window */
-	struct ui_window *window;
-	/** File name entry */
-	struct ui_entry *ename;
-	/** OK button */
-	struct ui_pbutton *bok;
-	/** Cancel button */
-	struct ui_pbutton *bcancel;
-	/** Prompt dialog callbacks */
-	struct ui_prompt_dialog_cb *cb;
-	/** Callback argument */
-	void *arg;
-};
-
-#endif
-
-/** @}
- */
Index: uspace/lib/ui/private/rbutton.h
===================================================================
--- uspace/lib/ui/private/rbutton.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/rbutton.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -77,7 +77,4 @@
 };
 
-extern errno_t ui_rbutton_paint_gfx(ui_rbutton_t *);
-extern errno_t ui_rbutton_paint_text(ui_rbutton_t *);
-
 #endif
 
Index: uspace/lib/ui/private/resource.h
===================================================================
--- uspace/lib/ui/private/resource.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/resource.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -59,7 +59,4 @@
 	bool textmode;
 
-	/** UI background color */
-	gfx_color_t *ui_bg_color;
-
 	/** Button frame color */
 	gfx_color_t *btn_frame_color;
@@ -105,8 +102,4 @@
 	/** Entry (text entry, checkbox, raido button) active background color */
 	gfx_color_t *entry_act_bg_color;
-	/** Entry selected text foreground color */
-	gfx_color_t *entry_sel_text_fg_color;
-	/** Entry selected text background color */
-	gfx_color_t *entry_sel_text_bg_color;
 
 	/** Expose callback or @c NULL */
Index: uspace/lib/ui/private/slider.h
===================================================================
--- uspace/lib/ui/private/slider.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/slider.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -66,7 +66,4 @@
 };
 
-extern errno_t ui_slider_paint_gfx(ui_slider_t *);
-extern errno_t ui_slider_paint_text(ui_slider_t *);
-
 #endif
 
Index: uspace/lib/ui/private/ui.h
===================================================================
--- uspace/lib/ui/private/ui.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/ui.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -39,5 +39,4 @@
 
 #include <adt/list.h>
-#include <gfx/coord.h>
 #include <display.h>
 #include <io/console.h>
@@ -55,6 +54,4 @@
 	/** Display */
 	display_t *display;
-	/** UI rectangle (only used in fullscreen mode) */
-	gfx_rect_t rect;
 	/** Output owned by UI, clean up when destroying UI */
 	bool myoutput;
Index: uspace/lib/ui/private/window.h
===================================================================
--- uspace/lib/ui/private/window.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/private/window.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -46,5 +46,4 @@
 #include <io/pos_event.h>
 #include <memgfx/memgc.h>
-#include <memgfx/xlategc.h>
 #include <types/ui/cursor.h>
 #include <types/ui/window.h>
@@ -71,12 +70,8 @@
 	/** Window memory GC (if client-side rendering) */
 	mem_gc_t *mgc;
-	/** Translating GC (if full screen & server-side rendering) */
-	xlate_gc_t *xgc;
 	/** Real window GC (if client-side rendering) */
 	gfx_context_t *realgc;
 	/** Window rectangle */
 	gfx_rect_t rect;
-	/** Display position (if fullscreen mode) */
-	gfx_coord2_t dpos;
 	/** Application area bitmap */
 	gfx_bitmap_t *app_bmp;
Index: uspace/lib/ui/src/checkbox.c
===================================================================
--- uspace/lib/ui/src/checkbox.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/checkbox.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -146,10 +146,10 @@
 }
 
-/** Paint check box in graphics mode.
+/** Paint check box.
  *
  * @param checkbox Check box
  * @return EOK on success or an error code
  */
-errno_t ui_checkbox_paint_gfx(ui_checkbox_t *checkbox)
+errno_t ui_checkbox_paint(ui_checkbox_t *checkbox)
 {
 	gfx_coord2_t pos;
@@ -222,65 +222,4 @@
 error:
 	return rc;
-}
-
-/** Paint check box in text mode.
- *
- * @param checkbox Check box
- * @return EOK on success or an error code
- */
-errno_t ui_checkbox_paint_text(ui_checkbox_t *checkbox)
-{
-	gfx_coord2_t pos;
-	gfx_text_fmt_t fmt;
-	bool depressed;
-	errno_t rc;
-
-	/* Paint checkbox */
-
-	depressed = checkbox->held && checkbox->inside;
-
-	pos.x = checkbox->rect.p0.x;
-	pos.y = checkbox->rect.p0.y;
-
-	gfx_text_fmt_init(&fmt);
-	fmt.color = depressed ? checkbox->res->entry_act_bg_color :
-	    checkbox->res->wnd_text_color;
-	fmt.halign = gfx_halign_left;
-	fmt.valign = gfx_valign_top;
-
-	rc = gfx_puttext(checkbox->res->font, &pos, &fmt,
-	    checkbox->checked ? "[X]" : "[ ]");
-	if (rc != EOK)
-		goto error;
-
-	/* Paint checkbox label */
-
-	pos.x += 4;
-	fmt.color = checkbox->res->wnd_text_color;
-
-	rc = gfx_puttext(checkbox->res->font, &pos, &fmt, checkbox->caption);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_update(checkbox->res->gc);
-	if (rc != EOK)
-		goto error;
-
-	return EOK;
-error:
-	return rc;
-}
-
-/** Paint check box.
- *
- * @param checkbox Check box
- * @return EOK on success or an error code
- */
-errno_t ui_checkbox_paint(ui_checkbox_t *checkbox)
-{
-	if (checkbox->res->textmode)
-		return ui_checkbox_paint_text(checkbox);
-	else
-		return ui_checkbox_paint_gfx(checkbox);
 }
 
Index: uspace/lib/ui/src/control.c
===================================================================
--- uspace/lib/ui/src/control.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/control.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -35,5 +35,4 @@
 
 #include <errno.h>
-#include <io/kbd_event.h>
 #include <io/pos_event.h>
 #include <stdlib.h>
@@ -92,18 +91,4 @@
 }
 
-/** Deliver keyboard event to UI control.
- *
- * @param control Control
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-ui_evclaim_t ui_control_kbd_event(ui_control_t *control, kbd_event_t *event)
-{
-	if (control->ops->kbd_event != NULL)
-		return control->ops->kbd_event(control->ext, event);
-	else
-		return ui_unclaimed;
-}
-
 /** Paint UI control.
  *
Index: uspace/lib/ui/src/entry.c
===================================================================
--- uspace/lib/ui/src/entry.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/entry.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -37,11 +37,8 @@
  */
 
-#include <clipboard.h>
 #include <errno.h>
 #include <gfx/context.h>
-#include <gfx/cursor.h>
 #include <gfx/render.h>
 #include <gfx/text.h>
-#include <macros.h>
 #include <stdlib.h>
 #include <str.h>
@@ -56,5 +53,4 @@
 static void ui_entry_ctl_destroy(void *);
 static errno_t ui_entry_ctl_paint(void *);
-static ui_evclaim_t ui_entry_ctl_kbd_event(void *, kbd_event_t *);
 static ui_evclaim_t ui_entry_ctl_pos_event(void *, pos_event_t *);
 
@@ -63,11 +59,5 @@
 	ui_entry_vpad = 4,
 	ui_entry_hpad_text = 1,
-	ui_entry_vpad_text = 0,
-	ui_entry_cursor_overshoot = 1,
-	ui_entry_cursor_width = 2,
-	ui_entry_sel_hpad = 0,
-	ui_entry_sel_vpad = 2,
-	/** Additional amount to scroll to the left after revealing cursor */
-	ui_entry_left_scroll_margin = 30
+	ui_entry_vpad_text = 0
 };
 
@@ -76,5 +66,4 @@
 	.destroy = ui_entry_ctl_destroy,
 	.paint = ui_entry_ctl_paint,
-	.kbd_event = ui_entry_ctl_kbd_event,
 	.pos_event = ui_entry_ctl_pos_event
 };
@@ -113,5 +102,4 @@
 	entry->halign = gfx_halign_left;
 	*rentry = entry;
-
 	return EOK;
 }
@@ -158,16 +146,4 @@
 {
 	entry->halign = halign;
-	ui_entry_scroll_update(entry, true);
-	ui_entry_paint(entry);
-}
-
-/** Set text entry read-only flag.
- *
- * @param entry Text entry
- * @param read_only True iff entry is to be read-only.
- */
-void ui_entry_set_read_only(ui_entry_t *entry, bool read_only)
-{
-	entry->read_only = read_only;
 }
 
@@ -188,107 +164,32 @@
 	free(entry->text);
 	entry->text = tcopy;
-	entry->pos = str_size(text);
-	entry->sel_start = entry->pos;
-
-	ui_entry_scroll_update(entry, false);
-	ui_entry_paint(entry);
 
 	return EOK;
 }
 
-/** Get entry text.
- *
- * @return Pointer to entry text.
- */
-const char *ui_entry_get_text(ui_entry_t *entry)
-{
-	return entry->text;
-}
-
-/** Paint cursor.
- *
- * @param entry Text entry
- * @param pos Cursor position (top-left corner of next character)
+/** Paint text entry.
+ *
+ * @param entry Text entry
  * @return EOK on success or an error code
  */
-static errno_t ui_entry_paint_cursor(ui_entry_t *entry, gfx_coord2_t *pos)
+errno_t ui_entry_paint(ui_entry_t *entry)
 {
 	ui_resource_t *res;
-	gfx_rect_t rect;
-	gfx_font_metrics_t metrics;
-	errno_t rc;
-
-	res = ui_window_get_res(entry->window);
-
-	if (res->textmode) {
-		rc = gfx_cursor_set_pos(res->gc, pos);
-		return rc;
-	}
-
-	gfx_font_get_metrics(res->font, &metrics);
-
-	rect.p0.x = pos->x;
-	rect.p0.y = pos->y - ui_entry_cursor_overshoot;
-	rect.p1.x = pos->x + ui_entry_cursor_width;
-	rect.p1.y = pos->y + metrics.ascent + metrics.descent + 1 +
-	    ui_entry_cursor_overshoot;
-
-	rc = gfx_set_color(res->gc, res->entry_fg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_fill_rect(res->gc, &rect);
-	if (rc != EOK)
-		goto error;
-
-	return EOK;
-error:
-	return rc;
-}
-
-/** Return width of text before cursor.
- *
- * @param entry Text entry
- * @return Widht of text before cursor
- */
-static gfx_coord_t ui_entry_lwidth(ui_entry_t *entry)
-{
-	ui_resource_t *res;
-	uint8_t tmp;
-	gfx_coord_t width;
-
-	res = ui_window_get_res(entry->window);
-
-	tmp = entry->text[entry->pos];
-
-	entry->text[entry->pos] = '\0';
-	width = gfx_text_width(res->font, entry->text);
-	entry->text[entry->pos] = tmp;
-
-	return width;
-}
-
-/** Paint text entry.
- *
- * @param entry Text entry
- * @return EOK on success or an error code
- */
-errno_t ui_entry_paint(ui_entry_t *entry)
-{
-	ui_resource_t *res;
-	ui_entry_geom_t geom;
 	gfx_text_fmt_t fmt;
 	gfx_coord2_t pos;
-	gfx_text_fmt_t cfmt;
-	gfx_coord2_t cpos;
+	gfx_coord_t hpad;
+	gfx_coord_t vpad;
 	gfx_rect_t inside;
-	unsigned off1, off2;
-	gfx_rect_t sel;
-	char c;
 	errno_t rc;
 
 	res = ui_window_get_res(entry->window);
 
-	ui_entry_get_geom(entry, &geom);
+	if (res->textmode) {
+		hpad = ui_entry_hpad_text;
+		vpad = ui_entry_vpad_text;
+	} else {
+		hpad = ui_entry_hpad;
+		vpad = ui_entry_vpad;
+	}
 
 	if (res->textmode == false) {
@@ -311,85 +212,25 @@
 		goto error;
 
-	pos = geom.text_pos;
+	switch (entry->halign) {
+	case gfx_halign_left:
+	case gfx_halign_justify:
+		pos.x = inside.p0.x + hpad;
+		break;
+	case gfx_halign_center:
+		pos.x = (inside.p0.x + inside.p1.x) / 2;
+		break;
+	case gfx_halign_right:
+		pos.x = inside.p1.x - hpad - 1;
+		break;
+	}
+
+	pos.y = inside.p0.y + vpad;
 
 	gfx_text_fmt_init(&fmt);
 	fmt.color = res->entry_fg_color;
-	fmt.halign = gfx_halign_left;
+	fmt.halign = entry->halign;
 	fmt.valign = gfx_valign_top;
 
-	rc = gfx_set_clip_rect(res->gc, &inside);
-	if (rc != EOK)
-		goto error;
-
-	off1 = min(entry->pos, entry->sel_start);
-	off2 = max(entry->pos, entry->sel_start);
-
-	/* Render initial segment before start of selection */
-	c = entry->text[off1];
-	entry->text[off1] = '\0';
-
 	rc = gfx_puttext(res->font, &pos, &fmt, entry->text);
-	if (rc != EOK) {
-		(void) gfx_set_clip_rect(res->gc, NULL);
-		goto error;
-	}
-
-	gfx_text_cont(res->font, &pos, &fmt, entry->text, &cpos, &cfmt);
-	entry->text[off1] = c;
-
-	/* Render selected text */
-
-	if (off1 != off2) {
-		c = entry->text[off2];
-		entry->text[off2] = '\0';
-		cfmt.color = res->entry_sel_text_fg_color;
-
-		gfx_text_rect(res->font, &cpos, &cfmt, entry->text + off1, &sel);
-		sel.p0.x -= ui_entry_sel_hpad;
-		sel.p0.y -= ui_entry_sel_vpad;
-		sel.p1.x += ui_entry_sel_hpad;
-		sel.p1.y += ui_entry_sel_vpad;
-
-		rc = gfx_set_color(res->gc, res->entry_sel_text_bg_color);
-		if (rc != EOK)
-			goto error;
-
-		rc = gfx_fill_rect(res->gc, &sel);
-		if (rc != EOK)
-			goto error;
-
-		rc = gfx_puttext(res->font, &cpos, &cfmt, entry->text + off1);
-		if (rc != EOK) {
-			(void) gfx_set_clip_rect(res->gc, NULL);
-			goto error;
-		}
-
-		gfx_text_cont(res->font, &cpos, &cfmt, entry->text + off1,
-		    &cpos, &cfmt);
-
-		entry->text[off2] = c;
-	}
-
-	/* Render trailing, non-selected text */
-	cfmt.color = res->entry_fg_color;
-
-	rc = gfx_puttext(res->font, &cpos, &cfmt, entry->text + off2);
-	if (rc != EOK) {
-		(void) gfx_set_clip_rect(res->gc, NULL);
-		goto error;
-	}
-
-	if (entry->active) {
-		/* Cursor */
-		pos.x += ui_entry_lwidth(entry);
-
-		rc = ui_entry_paint_cursor(entry, &pos);
-		if (rc != EOK) {
-			(void) gfx_set_clip_rect(res->gc, NULL);
-			goto error;
-		}
-	}
-
-	rc = gfx_set_clip_rect(res->gc, NULL);
 	if (rc != EOK)
 		goto error;
@@ -404,28 +245,4 @@
 }
 
-/** Find position in text entry.
- *
- * @param entry Text entry
- * @param fpos Position for which we need to find text offset
- * @return Corresponding byte offset in entry text
- */
-size_t ui_entry_find_pos(ui_entry_t *entry, gfx_coord2_t *fpos)
-{
-	ui_resource_t *res;
-	ui_entry_geom_t geom;
-	gfx_text_fmt_t fmt;
-
-	res = ui_window_get_res(entry->window);
-
-	ui_entry_get_geom(entry, &geom);
-
-	gfx_text_fmt_init(&fmt);
-	fmt.halign = gfx_halign_left;
-	fmt.valign = gfx_valign_top;
-
-	return gfx_text_find_pos(res->font, &geom.text_pos, &fmt,
-	    entry->text, fpos);
-}
-
 /** Destroy text entry control.
  *
@@ -451,351 +268,14 @@
 }
 
-/** Delete selected text.
- *
- * @param entry Text entry
- */
-void ui_entry_delete_sel(ui_entry_t *entry)
-{
-	size_t off1;
-	size_t off2;
-
-	off1 = min(entry->sel_start, entry->pos);
-	off2 = max(entry->sel_start, entry->pos);
-
-	memmove(entry->text + off1, entry->text + off2,
-	    str_size(entry->text + off2) + 1);
-
-	entry->pos = off1;
-	entry->sel_start = off1;
-	ui_entry_scroll_update(entry, false);
-	ui_entry_paint(entry);
-}
-
-/** Insert string at cursor position.
- *
- * @param entry Text entry
- * @param str String
- * @return EOK on success, ENOMEM if out of memory
- */
-errno_t ui_entry_insert_str(ui_entry_t *entry, const char *str)
-{
-	uint8_t tmp;
-	char *ltext = NULL;
-	char *newtext;
-	char *oldtext;
-	int rc;
-
-	/* Do we have a selection? */
-	if (entry->sel_start != entry->pos)
-		ui_entry_delete_sel(entry);
-
-	tmp = entry->text[entry->pos];
-	entry->text[entry->pos] = '\0';
-	ltext = str_dup(entry->text);
-	if (ltext == NULL)
-		return ENOMEM;
-
-	entry->text[entry->pos] = tmp;
-
-	rc = asprintf(&newtext, "%s%s%s", ltext, str, entry->text + entry->pos);
-	if (rc < 0) {
-		free(ltext);
-		return ENOMEM;
-	}
-
-	oldtext = entry->text;
-	entry->text = newtext;
-	entry->pos += str_size(str);
-	free(oldtext);
-	free(ltext);
-
-	entry->sel_start = entry->pos;
-	ui_entry_scroll_update(entry, false);
-	ui_entry_paint(entry);
-
-	return EOK;
-}
-
-/** Delete character before cursor.
- *
- * @param entry Text entry
- */
-void ui_entry_backspace(ui_entry_t *entry)
-{
-	size_t off;
-
-	/* Do we have a selection? */
-	if (entry->sel_start != entry->pos) {
-		ui_entry_delete_sel(entry);
-		return;
-	}
-
-	if (entry->pos == 0)
-		return;
-
-	/* Find offset where character before cursor starts */
-	off = entry->pos;
-	(void) str_decode_reverse(entry->text, &off,
-	    str_size(entry->text));
-
-	memmove(entry->text + off, entry->text + entry->pos,
-	    str_size(entry->text + entry->pos) + 1);
-	entry->pos = off;
-	entry->sel_start = off;
-
-	ui_entry_scroll_update(entry, false);
-	ui_entry_paint(entry);
-}
-
-/** Delete character after cursor.
- *
- * @param entry Text entry
- */
-void ui_entry_delete(ui_entry_t *entry)
-{
-	size_t off;
-
-	/* Do we have a selection? */
-	if (entry->sel_start != entry->pos) {
-		ui_entry_delete_sel(entry);
-		return;
-	}
-
-	/* Find offset where character after cursor ends */
-	off = entry->pos;
-	(void) str_decode(entry->text, &off,
-	    str_size(entry->text));
-
-	memmove(entry->text + entry->pos, entry->text + off,
-	    str_size(entry->text + off) + 1);
-
-	ui_entry_scroll_update(entry, false);
-	ui_entry_paint(entry);
-}
-
-/** Copy selected text to clipboard.
- *
- * @param entry Text entry
- */
-void ui_entry_copy(ui_entry_t *entry)
-{
-	unsigned off1;
-	unsigned off2;
-	char c;
-
-	off1 = min(entry->pos, entry->sel_start);
-	off2 = max(entry->pos, entry->sel_start);
-
-	c = entry->text[off2];
-	entry->text[off2] = '\0';
-
-	(void) clipboard_put_str(entry->text + off1);
-
-	entry->text[off2] = c;
-}
-
-/** Cut selected text to clipboard.
- *
- * @param entry Text entry
- */
-void ui_entry_cut(ui_entry_t *entry)
-{
-	ui_entry_copy(entry);
-	ui_entry_delete_sel(entry);
-}
-
-/** Paste text from clipboard.
- *
- * @param entry Text entry
- */
-void ui_entry_paste(ui_entry_t *entry)
-{
-	char *str;
-	errno_t rc;
-
-	rc = clipboard_get_str(&str);
-	if (rc != EOK)
-		return;
-
-	ui_entry_insert_str(entry, str);
-	free(str);
-}
-
-/** Handle text entry key press without modifiers.
- *
- * @param entry Text entry
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-ui_evclaim_t ui_entry_key_press_unmod(ui_entry_t *entry, kbd_event_t *event)
-{
-	assert(event->type == KEY_PRESS);
-
-	switch (event->key) {
-	case KC_BACKSPACE:
-		ui_entry_backspace(entry);
-		break;
-
-	case KC_DELETE:
-		ui_entry_delete(entry);
-		break;
-
-	case KC_ESCAPE:
-		ui_entry_deactivate(entry);
-		break;
-
-	case KC_HOME:
-		ui_entry_seek_start(entry, false);
-		break;
-
-	case KC_END:
-		ui_entry_seek_end(entry, false);
-		break;
-
-	case KC_LEFT:
-		ui_entry_seek_prev_char(entry, false);
-		break;
-
-	case KC_RIGHT:
-		ui_entry_seek_next_char(entry, false);
-		break;
-
-	default:
-		break;
-	}
-
-	return ui_claimed;
-}
-
-/** Handle text entry key press with shift modifier.
- *
- * @param entry Text entry
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-ui_evclaim_t ui_entry_key_press_shift(ui_entry_t *entry, kbd_event_t *event)
-{
-	assert(event->type == KEY_PRESS);
-
-	switch (event->key) {
-	case KC_HOME:
-		ui_entry_seek_start(entry, true);
-		break;
-
-	case KC_END:
-		ui_entry_seek_end(entry, true);
-		break;
-
-	case KC_LEFT:
-		ui_entry_seek_prev_char(entry, true);
-		break;
-
-	case KC_RIGHT:
-		ui_entry_seek_next_char(entry, true);
-		break;
-
-	default:
-		break;
-	}
-
-	return ui_claimed;
-}
-
-/** Handle text entry key press with control modifier.
- *
- * @param entry Text entry
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-ui_evclaim_t ui_entry_key_press_ctrl(ui_entry_t *entry, kbd_event_t *event)
-{
-	assert(event->type == KEY_PRESS);
-
-	switch (event->key) {
-	case KC_C:
-		ui_entry_copy(entry);
-		break;
-	case KC_V:
-		ui_entry_paste(entry);
-		break;
-	case KC_X:
-		ui_entry_cut(entry);
-		break;
-	default:
-		break;
-	}
-
-	return ui_claimed;
-}
-
-/** Handle text entry keyboard event.
- *
- * @param entry Text entry
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-ui_evclaim_t ui_entry_kbd_event(ui_entry_t *entry, kbd_event_t *event)
-{
-	char buf[STR_BOUNDS(1) + 1];
-	size_t off;
-	errno_t rc;
-
-	if (!entry->active)
-		return ui_unclaimed;
-
-	if (event->type == KEY_PRESS && event->c >= ' ') {
-		off = 0;
-		rc = chr_encode(event->c, buf, &off, sizeof(buf));
-		if (rc == EOK) {
-			buf[off] = '\0';
-			(void) ui_entry_insert_str(entry, buf);
-		}
-	}
-
-	/*
-	 * Need to keep track if any shift is held for the case
-	 * of selecting by shift-click. This could be simplified
-	 * if position events were decorated with modifier
-	 * state.
-	 */
-
-	if (event->type == KEY_PRESS && event->key == KC_LSHIFT)
-		entry->lshift_held = true;
-	if (event->type == KEY_RELEASE && event->key == KC_LSHIFT)
-		entry->lshift_held = false;
-	if (event->type == KEY_PRESS && event->key == KC_RSHIFT)
-		entry->rshift_held = true;
-	if (event->type == KEY_RELEASE && event->key == KC_RSHIFT)
-		entry->rshift_held = false;
-
-	if (event->type == KEY_PRESS &&
-	    (event->mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0)
-		return ui_entry_key_press_unmod(entry, event);
-
-	if (event->type == KEY_PRESS &&
-	    (event->mods & KM_SHIFT) != 0 &&
-	    (event->mods & (KM_CTRL | KM_ALT)) == 0)
-		return ui_entry_key_press_shift(entry, event);
-
-	if (event->type == KEY_PRESS &&
-	    (event->mods & KM_CTRL) != 0 &&
-	    (event->mods & (KM_ALT | KM_SHIFT)) == 0)
-		return ui_entry_key_press_ctrl(entry, event);
-
-	return ui_claimed;
-}
-
-/** Handle text entry position event.
- *
- * @param entry Text entry
+/** Handle text entry control position event.
+ *
+ * @param arg Argument (ui_entry_t *)
  * @param pos_event Position event
  * @return @c ui_claimed iff the event is claimed
  */
-ui_evclaim_t ui_entry_pos_event(ui_entry_t *entry, pos_event_t *event)
-{
+ui_evclaim_t ui_entry_ctl_pos_event(void *arg, pos_event_t *event)
+{
+	ui_entry_t *entry = (ui_entry_t *) arg;
 	gfx_coord2_t pos;
-
-	if (entry->read_only)
-		return ui_unclaimed;
 
 	if (event->type == POS_UPDATE) {
@@ -803,5 +283,4 @@
 		pos.y = event->vpos;
 
-		/* Change cursor shape when pointer is entering/leaving */
 		if (gfx_pix_inside_rect(&pos, &entry->rect)) {
 			if (!entry->pointer_inside) {
@@ -817,42 +296,4 @@
 			}
 		}
-
-		if (entry->held) {
-			/*
-			 * Selecting using mouse drag: Change pos,
-			 * keep sel_start
-			 */
-			entry->pos = ui_entry_find_pos(entry, &pos);
-			ui_entry_paint(entry);
-		}
-	}
-
-	if (event->type == POS_PRESS) {
-		pos.x = event->hpos;
-		pos.y = event->vpos;
-
-		if (gfx_pix_inside_rect(&pos, &entry->rect)) {
-			/* Clicked inside - activate, set position */
-			entry->held = true;
-			entry->pos = ui_entry_find_pos(entry, &pos);
-
-			/* Clear selection if no shift key is held */
-			if (!entry->lshift_held && !entry->rshift_held)
-				entry->sel_start = entry->pos;
-
-			if (entry->active)
-				ui_entry_paint(entry);
-			else
-				ui_entry_activate(entry);
-
-			return ui_claimed;
-		} else {
-			/* Clicked outside - deactivate */
-			ui_entry_deactivate(entry);
-		}
-	}
-
-	if (event->type == POS_RELEASE) {
-		entry->held = false;
 	}
 
@@ -860,267 +301,4 @@
 }
 
-/** Handle text entry control keyboard event.
- *
- * @param arg Argument (ui_entry_t *)
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-static ui_evclaim_t ui_entry_ctl_kbd_event(void *arg, kbd_event_t *event)
-{
-	ui_entry_t *entry = (ui_entry_t *) arg;
-
-	return ui_entry_kbd_event(entry, event);
-}
-
-/** Handle text entry control position event.
- *
- * @param arg Argument (ui_entry_t *)
- * @param pos_event Position event
- * @return @c ui_claimed iff the event is claimed
- */
-static ui_evclaim_t ui_entry_ctl_pos_event(void *arg, pos_event_t *event)
-{
-	ui_entry_t *entry = (ui_entry_t *) arg;
-
-	return ui_entry_pos_event(entry, event);
-}
-
-/** Get text entry geometry.
- *
- * @param entry Text entry
- * @param geom Structure to fill in with computed geometry
- */
-void ui_entry_get_geom(ui_entry_t *entry, ui_entry_geom_t *geom)
-{
-	gfx_coord_t hpad;
-	gfx_coord_t vpad;
-	ui_resource_t *res;
-
-	res = ui_window_get_res(entry->window);
-
-	if (res->textmode) {
-		hpad = ui_entry_hpad_text;
-		vpad = ui_entry_vpad_text;
-	} else {
-		hpad = ui_entry_hpad;
-		vpad = ui_entry_vpad;
-	}
-
-	if (res->textmode == false) {
-		ui_paint_get_inset_frame_inside(res, &entry->rect,
-		    &geom->interior_rect);
-	} else {
-		geom->interior_rect = entry->rect;
-	}
-
-	geom->text_rect.p0.x = geom->interior_rect.p0.x + hpad;
-	geom->text_rect.p0.y = geom->interior_rect.p0.y + vpad;
-	geom->text_rect.p1.x = geom->interior_rect.p1.x - hpad;
-	geom->text_rect.p1.y = geom->interior_rect.p1.y - vpad;
-
-	geom->text_pos.x = geom->interior_rect.p0.x + hpad +
-	    entry->scroll_pos;
-	geom->text_pos.y = geom->interior_rect.p0.y + vpad;
-
-	switch (entry->halign) {
-	case gfx_halign_left:
-	case gfx_halign_justify:
-		geom->anchor_x = geom->text_rect.p0.x;
-		break;
-	case gfx_halign_center:
-		geom->anchor_x = (geom->text_rect.p0.x +
-		    geom->text_rect.p1.x) / 2;
-		break;
-	case gfx_halign_right:
-		geom->anchor_x = geom->text_rect.p1.x;
-		break;
-	}
-}
-
-/** Activate text entry.
- *
- * @param entry Text entry
- */
-void ui_entry_activate(ui_entry_t *entry)
-{
-	ui_resource_t *res;
-
-	res = ui_window_get_res(entry->window);
-
-	if (entry->active)
-		return;
-
-	entry->active = true;
-	(void) ui_entry_paint(entry);
-
-	if (res->textmode)
-		gfx_cursor_set_visible(res->gc, true);
-}
-
-/** Move text cursor to the beginning of text.
- *
- * @param entry Text entry
- * @param shift @c true iff shift key is pressed
- */
-void ui_entry_seek_start(ui_entry_t *entry, bool shift)
-{
-	entry->pos = 0;
-
-	if (!shift)
-		entry->sel_start = entry->pos;
-
-	ui_entry_scroll_update(entry, false);
-	(void) ui_entry_paint(entry);
-}
-
-/** Move text cursor to the end of text.
- *
- * @param entry Text entry
- * @param shift @c true iff shift key is pressed
- */
-void ui_entry_seek_end(ui_entry_t *entry, bool shift)
-{
-	entry->pos = str_size(entry->text);
-
-	if (!shift)
-		entry->sel_start = entry->pos;
-
-	ui_entry_scroll_update(entry, false);
-	(void) ui_entry_paint(entry);
-}
-
-/** Move text cursor one character backward.
- *
- * @param entry Text entry
- * @param shift @c true iff shift key is pressed
- */
-void ui_entry_seek_prev_char(ui_entry_t *entry, bool shift)
-{
-	size_t off;
-
-	off = entry->pos;
-	(void) str_decode_reverse(entry->text, &off,
-	    str_size(entry->text));
-	entry->pos = off;
-
-	if (!shift)
-		entry->sel_start = entry->pos;
-
-	ui_entry_scroll_update(entry, false);
-	(void) ui_entry_paint(entry);
-}
-
-/** Move text cursor one character forward.
- *
- * @param entry Text entry
- * @param shift @c true iff shift key is pressed
- */
-void ui_entry_seek_next_char(ui_entry_t *entry, bool shift)
-{
-	size_t off;
-
-	off = entry->pos;
-	(void) str_decode(entry->text, &off,
-	    str_size(entry->text));
-	entry->pos = off;
-
-	if (!shift)
-		entry->sel_start = entry->pos;
-
-	ui_entry_scroll_update(entry, false);
-	(void) ui_entry_paint(entry);
-}
-
-/** Deactivate text entry.
- *
- * @param entry Text entry
- */
-void ui_entry_deactivate(ui_entry_t *entry)
-{
-	ui_resource_t *res;
-
-	res = ui_window_get_res(entry->window);
-
-	if (!entry->active)
-		return;
-
-	entry->active = false;
-	entry->sel_start = entry->pos;
-	(void) ui_entry_paint(entry);
-
-	if (res->textmode)
-		gfx_cursor_set_visible(res->gc, false);
-}
-
-/** Update text entry scroll position.
- *
- * @param entry Text entry
- * @param realign @c true iff we should left-align short text.
- *                This should be only used when changing text alignment,
- *                because left-aligned text entries should not realign
- *                the text to the left side under normal circumstances.
- */
-void ui_entry_scroll_update(ui_entry_t *entry, bool realign)
-{
-	ui_entry_geom_t geom;
-	gfx_coord_t x;
-	gfx_coord_t width;
-	gfx_coord2_t tpos;
-	gfx_coord2_t anchor;
-	gfx_text_fmt_t fmt;
-	ui_resource_t *res;
-
-	res = ui_window_get_res(entry->window);
-
-	ui_entry_get_geom(entry, &geom);
-
-	/* Compute position where cursor is currently displayed at */
-	x = geom.text_pos.x + ui_entry_lwidth(entry);
-
-	/* Is cursor off to the left? */
-	if (x < geom.text_rect.p0.x) {
-		/*
-		 * Scroll to make cursor visible and put some space between it
-		 * and the left edge of the text rectangle.
-		 */
-		entry->scroll_pos += geom.text_rect.p0.x - x +
-		    ui_entry_left_scroll_margin;
-
-		/*
-		 * We don't want to scroll further than what's needed
-		 * to reveal the beginning of the text.
-		 */
-		if (entry->scroll_pos > 0)
-			entry->scroll_pos = 0;
-	}
-
-	/*
-	 * Is cursor off to the right? Note that the width of the cursor
-	 * is deliberately not taken into account (i.e. we only care
-	 * about the left edge of the cursor).
-	 */
-	if (x > geom.text_rect.p1.x)
-		entry->scroll_pos -= x - geom.text_rect.p1.x;
-
-	width = gfx_text_width(res->font, entry->text);
-
-	if (width < geom.text_rect.p1.x - geom.text_rect.p0.x &&
-	    (realign || entry->halign != gfx_halign_left)) {
-		/* Text fits inside entry, so we need to align it */
-		anchor.x = geom.anchor_x;
-		anchor.y = 0;
-		gfx_text_fmt_init(&fmt);
-		fmt.halign = entry->halign;
-		gfx_text_start_pos(res->font, &anchor, &fmt, entry->text,
-		    &tpos);
-		entry->scroll_pos = tpos.x - geom.text_rect.p0.x;
-	} else if (geom.text_pos.x + width < geom.text_rect.p1.x &&
-	    entry->halign != gfx_halign_left) {
-		/* Text is long, unused space on the right */
-		entry->scroll_pos += geom.text_rect.p1.x -
-		    geom.text_pos.x - width;
-	}
-}
-
 /** @}
  */
Index: pace/lib/ui/src/filedialog.c
===================================================================
--- uspace/lib/ui/src/filedialog.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,382 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file File dialog
- */
-
-#include <errno.h>
-#include <mem.h>
-#include <stdlib.h>
-#include <ui/entry.h>
-#include <ui/fixed.h>
-#include <ui/label.h>
-#include <ui/filedialog.h>
-#include <ui/pbutton.h>
-#include <ui/resource.h>
-#include <ui/ui.h>
-#include <ui/window.h>
-#include "../private/filedialog.h"
-
-static void ui_file_dialog_wnd_close(ui_window_t *, void *);
-static void ui_file_dialog_wnd_kbd(ui_window_t *, void *, kbd_event_t *);
-
-ui_window_cb_t ui_file_dialog_wnd_cb = {
-	.close = ui_file_dialog_wnd_close,
-	.kbd = ui_file_dialog_wnd_kbd
-};
-
-static void ui_file_dialog_bok_clicked(ui_pbutton_t *, void *);
-static void ui_file_dialog_bcancel_clicked(ui_pbutton_t *, void *);
-
-ui_pbutton_cb_t ui_file_dialog_bok_cb = {
-	.clicked = ui_file_dialog_bok_clicked
-};
-
-ui_pbutton_cb_t ui_file_dialog_bcancel_cb = {
-	.clicked = ui_file_dialog_bcancel_clicked
-};
-
-/** Initialize file dialog parameters structure.
- *
- * File dialog parameters structure must always be initialized using
- * this function first.
- *
- * @param params File dialog parameters structure
- */
-void ui_file_dialog_params_init(ui_file_dialog_params_t *params)
-{
-	memset(params, 0, sizeof(ui_file_dialog_params_t));
-	params->ifname = "";
-}
-
-/** Create new file dialog.
- *
- * @param ui User interface
- * @param params File dialog parameters
- * @param rdialog Place to store pointer to new dialog
- * @return EOK on success or an error code
- */
-errno_t ui_file_dialog_create(ui_t *ui, ui_file_dialog_params_t *params,
-    ui_file_dialog_t **rdialog)
-{
-	errno_t rc;
-	ui_file_dialog_t *dialog;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t wparams;
-	ui_fixed_t *fixed = NULL;
-	ui_label_t *label = NULL;
-	ui_entry_t *entry = NULL;
-	ui_pbutton_t *bok = NULL;
-	ui_pbutton_t *bcancel = NULL;
-	gfx_rect_t rect;
-	ui_resource_t *ui_res;
-
-	dialog = calloc(1, sizeof(ui_file_dialog_t));
-	if (dialog == NULL) {
-		rc = ENOMEM;
-		goto error;
-	}
-
-	ui_wnd_params_init(&wparams);
-	wparams.caption = params->caption;
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		wparams.rect.p0.x = 0;
-		wparams.rect.p0.y = 0;
-		wparams.rect.p1.x = 40;
-		wparams.rect.p1.y = 9;
-	} else {
-		wparams.rect.p0.x = 0;
-		wparams.rect.p0.y = 0;
-		wparams.rect.p1.x = 300;
-		wparams.rect.p1.y = 135;
-	}
-
-	rc = ui_window_create(ui, &wparams, &window);
-	if (rc != EOK)
-		goto error;
-
-	ui_window_set_cb(window, &ui_file_dialog_wnd_cb, dialog);
-
-	ui_res = ui_window_get_res(window);
-
-	rc = ui_fixed_create(&fixed);
-	if (rc != EOK)
-		goto error;
-
-	rc = ui_label_create(ui_res, "File Name:", &label);
-	if (rc != EOK)
-		goto error;
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 3;
-		rect.p0.y = 2;
-		rect.p1.x = 17;
-		rect.p1.y = 3;
-	} else {
-		rect.p0.x = 10;
-		rect.p0.y = 35;
-		rect.p1.x = 190;
-		rect.p1.y = 50;
-	}
-
-	ui_label_set_rect(label, &rect);
-
-	rc = ui_fixed_add(fixed, ui_label_ctl(label));
-	if (rc != EOK)
-		goto error;
-
-	label = NULL;
-
-	rc = ui_entry_create(window, params->ifname, &entry);
-	if (rc != EOK)
-		goto error;
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 3;
-		rect.p0.y = 4;
-		rect.p1.x = 37;
-		rect.p1.y = 5;
-	} else {
-		rect.p0.x = 10;
-		rect.p0.y = 55;
-		rect.p1.x = 290;
-		rect.p1.y = 80;
-	}
-
-	ui_entry_set_rect(entry, &rect);
-
-	rc = ui_fixed_add(fixed, ui_entry_ctl(entry));
-	if (rc != EOK)
-		goto error;
-
-	ui_entry_activate(entry);
-
-	/* Select all */
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_end(entry, true);
-
-	dialog->ename = entry;
-	entry = NULL;
-
-	rc = ui_pbutton_create(ui_res, "OK", &bok);
-	if (rc != EOK)
-		goto error;
-
-	ui_pbutton_set_cb(bok, &ui_file_dialog_bok_cb, dialog);
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 10;
-		rect.p0.y = 6;
-		rect.p1.x = 20;
-		rect.p1.y = 7;
-	} else {
-		rect.p0.x = 55;
-		rect.p0.y = 90;
-		rect.p1.x = 145;
-		rect.p1.y = 118;
-	}
-
-	ui_pbutton_set_rect(bok, &rect);
-
-	ui_pbutton_set_default(bok, true);
-
-	rc = ui_fixed_add(fixed, ui_pbutton_ctl(bok));
-	if (rc != EOK)
-		goto error;
-
-	dialog->bok = bok;
-	bok = NULL;
-
-	rc = ui_pbutton_create(ui_res, "Cancel", &bcancel);
-	if (rc != EOK)
-		goto error;
-
-	ui_pbutton_set_cb(bcancel, &ui_file_dialog_bcancel_cb, dialog);
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 22;
-		rect.p0.y = 6;
-		rect.p1.x = 32;
-		rect.p1.y = 7;
-	} else {
-		rect.p0.x = 155;
-		rect.p0.y = 90;
-		rect.p1.x = 245;
-		rect.p1.y = 118;
-	}
-
-	ui_pbutton_set_rect(bcancel, &rect);
-
-	rc = ui_fixed_add(fixed, ui_pbutton_ctl(bcancel));
-	if (rc != EOK)
-		goto error;
-
-	dialog->bcancel = bcancel;
-	bcancel = NULL;
-
-	ui_window_add(window, ui_fixed_ctl(fixed));
-	fixed = NULL;
-
-	rc = ui_window_paint(window);
-	if (rc != EOK)
-		goto error;
-
-	dialog->window = window;
-	*rdialog = dialog;
-	return EOK;
-error:
-	if (entry != NULL)
-		ui_entry_destroy(entry);
-	if (bok != NULL)
-		ui_pbutton_destroy(bok);
-	if (bcancel != NULL)
-		ui_pbutton_destroy(bcancel);
-	if (label != NULL)
-		ui_label_destroy(label);
-	if (fixed != NULL)
-		ui_fixed_destroy(fixed);
-	if (window != NULL)
-		ui_window_destroy(window);
-	if (dialog != NULL)
-		free(dialog);
-	return rc;
-}
-
-/** Destroy file dialog.
- *
- * @param dialog File dialog or @c NULL
- */
-void ui_file_dialog_destroy(ui_file_dialog_t *dialog)
-{
-	if (dialog == NULL)
-		return;
-
-	ui_window_destroy(dialog->window);
-	free(dialog);
-}
-
-/** Set mesage dialog callback.
- *
- * @param dialog File dialog
- * @param cb File dialog callbacks
- * @param arg Callback argument
- */
-void ui_file_dialog_set_cb(ui_file_dialog_t *dialog, ui_file_dialog_cb_t *cb,
-    void *arg)
-{
-	dialog->cb = cb;
-	dialog->arg = arg;
-}
-
-/** File dialog window close handler.
- *
- * @param window Window
- * @param arg Argument (ui_file_dialog_t *)
- */
-static void ui_file_dialog_wnd_close(ui_window_t *window, void *arg)
-{
-	ui_file_dialog_t *dialog = (ui_file_dialog_t *) arg;
-
-	if (dialog->cb != NULL && dialog->cb->close != NULL)
-		dialog->cb->close(dialog, dialog->arg);
-}
-
-/** File dialog window keyboard event handler.
- *
- * @param window Window
- * @param arg Argument (ui_prompt_dialog_t *)
- * @param event Keyboard event
- */
-static void ui_file_dialog_wnd_kbd(ui_window_t *window, void *arg,
-    kbd_event_t *event)
-{
-	ui_file_dialog_t *dialog = (ui_file_dialog_t *) arg;
-	const char *fname;
-
-	if (event->type == KEY_PRESS &&
-	    (event->mods & (KM_CTRL | KM_SHIFT | KM_ALT)) == 0) {
-		if (event->key == KC_ENTER) {
-			/* Confirm */
-			if (dialog->cb != NULL && dialog->cb->bok != NULL) {
-				fname = ui_entry_get_text(dialog->ename);
-				dialog->cb->bok(dialog, dialog->arg, fname);
-				return;
-			}
-		} else if (event->key == KC_ESCAPE) {
-			/* Cancel */
-			if (dialog->cb != NULL && dialog->cb->bcancel != NULL) {
-				dialog->cb->bcancel(dialog, dialog->arg);
-				return;
-			}
-		}
-	}
-
-	ui_window_def_kbd(window, event);
-}
-
-/** File dialog OK button click handler.
- *
- * @param pbutton Push button
- * @param arg Argument (ui_file_dialog_t *)
- */
-static void ui_file_dialog_bok_clicked(ui_pbutton_t *pbutton, void *arg)
-{
-	ui_file_dialog_t *dialog = (ui_file_dialog_t *) arg;
-	const char *fname;
-
-	if (dialog->cb != NULL && dialog->cb->bok != NULL) {
-		fname = ui_entry_get_text(dialog->ename);
-		dialog->cb->bok(dialog, dialog->arg, fname);
-	}
-}
-
-/** File dialog cancel button click handler.
- *
- * @param pbutton Push button
- * @param arg Argument (ui_file_dialog_t *)
- */
-static void ui_file_dialog_bcancel_clicked(ui_pbutton_t *pbutton, void *arg)
-{
-	ui_file_dialog_t *dialog = (ui_file_dialog_t *) arg;
-
-	if (dialog->cb != NULL && dialog->cb->bcancel != NULL)
-		dialog->cb->bcancel(dialog, dialog->arg);
-}
-
-/** @}
- */
Index: uspace/lib/ui/src/fixed.c
===================================================================
--- uspace/lib/ui/src/fixed.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/fixed.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -46,5 +46,4 @@
 static void ui_fixed_ctl_destroy(void *);
 static errno_t ui_fixed_ctl_paint(void *);
-static ui_evclaim_t ui_fixed_ctl_kbd_event(void *, kbd_event_t *);
 static ui_evclaim_t ui_fixed_ctl_pos_event(void *, pos_event_t *);
 static void ui_fixed_ctl_unfocus(void *);
@@ -54,5 +53,4 @@
 	.destroy = ui_fixed_ctl_destroy,
 	.paint = ui_fixed_ctl_paint,
-	.kbd_event = ui_fixed_ctl_kbd_event,
 	.pos_event = ui_fixed_ctl_pos_event,
 	.unfocus = ui_fixed_ctl_unfocus
@@ -213,27 +211,4 @@
 }
 
-/** Handle fixed layout keyboard event.
- *
- * @param fixed Fixed layout
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-ui_evclaim_t ui_fixed_kbd_event(ui_fixed_t *fixed, kbd_event_t *event)
-{
-	ui_fixed_elem_t *elem;
-	ui_evclaim_t claimed;
-
-	elem = ui_fixed_first(fixed);
-	while (elem != NULL) {
-		claimed = ui_control_kbd_event(elem->control, event);
-		if (claimed == ui_claimed)
-			return ui_claimed;
-
-		elem = ui_fixed_next(elem);
-	}
-
-	return ui_unclaimed;
-}
-
 /** Handle fixed layout position event.
  *
@@ -298,17 +273,4 @@
 }
 
-/** Handle fixed layout control keyboard event.
- *
- * @param arg Argument (ui_fixed_t *)
- * @param kbd_event Keyboard event
- * @return @c ui_claimed iff the event is claimed
- */
-ui_evclaim_t ui_fixed_ctl_kbd_event(void *arg, kbd_event_t *event)
-{
-	ui_fixed_t *fixed = (ui_fixed_t *) arg;
-
-	return ui_fixed_kbd_event(fixed, event);
-}
-
 /** Handle fixed layout control position event.
  *
Index: uspace/lib/ui/src/label.c
===================================================================
--- uspace/lib/ui/src/label.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/label.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -134,14 +134,4 @@
 {
 	label->halign = halign;
-}
-
-/** Set label vertical text alignment.
- *
- * @param label Label
- * @param valign Vertical alignment
- */
-void ui_label_set_valign(ui_label_t *label, gfx_valign_t valign)
-{
-	label->valign = valign;
 }
 
@@ -200,17 +190,5 @@
 	}
 
-	switch (label->valign) {
-	case gfx_valign_top:
-		pos.y = label->rect.p0.y;
-		break;
-	case gfx_valign_center:
-		pos.y = (label->rect.p0.y + label->rect.p1.y) / 2;
-		break;
-	case gfx_valign_bottom:
-		pos.y = label->rect.p1.y;
-		break;
-	case gfx_valign_baseline:
-		return EINVAL;
-	}
+	pos.y = label->rect.p0.y;
 
 	gfx_text_fmt_init(&fmt);
Index: uspace/lib/ui/src/menu.c
===================================================================
--- uspace/lib/ui/src/menu.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/menu.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -58,6 +58,5 @@
 	menu_frame_h = 4,
 	menu_frame_w_text = 2,
-	menu_frame_h_text = 1,
-	menu_frame_h_margin_text = 1
+	menu_frame_h_text = 1
 };
 
@@ -277,86 +276,4 @@
  * @return EOK on success or an error code
  */
-errno_t ui_menu_paint_bg_gfx(ui_menu_t *menu, gfx_coord2_t *spos)
-{
-	ui_resource_t *res;
-	ui_menu_geom_t geom;
-	gfx_rect_t bg_rect;
-	errno_t rc;
-
-	res = ui_menu_get_res(menu);
-	ui_menu_get_geom(menu, spos, &geom);
-
-	/* Paint menu frame */
-
-	rc = gfx_set_color(res->gc, res->wnd_face_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = ui_paint_outset_frame(res, &geom.outer_rect, &bg_rect);
-	if (rc != EOK)
-		goto error;
-
-	/* Paint menu background */
-
-	rc = gfx_set_color(res->gc, res->wnd_face_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_fill_rect(res->gc, &bg_rect);
-	if (rc != EOK)
-		goto error;
-
-	return EOK;
-error:
-	return rc;
-}
-
-/** Paint menu.
- *
- * @param menu Menu
- * @param spos Starting position (top-left corner)
- * @return EOK on success or an error code
- */
-errno_t ui_menu_paint_bg_text(ui_menu_t *menu, gfx_coord2_t *spos)
-{
-	ui_resource_t *res;
-	ui_menu_geom_t geom;
-	gfx_rect_t rect;
-	errno_t rc;
-
-	res = ui_menu_get_res(menu);
-	ui_menu_get_geom(menu, spos, &geom);
-
-	/* Paint menu background */
-
-	rc = gfx_set_color(res->gc, res->wnd_face_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_fill_rect(res->gc, &geom.outer_rect);
-	if (rc != EOK)
-		goto error;
-
-	/* Paint menu box */
-
-	rect = geom.outer_rect;
-	rect.p0.x += menu_frame_h_margin_text;
-	rect.p1.x -= menu_frame_h_margin_text;
-
-	rc = ui_paint_text_box(res, &rect, ui_box_single, res->wnd_face_color);
-	if (rc != EOK)
-		goto error;
-
-	return EOK;
-error:
-	return rc;
-}
-
-/** Paint menu.
- *
- * @param menu Menu
- * @param spos Starting position (top-left corner)
- * @return EOK on success or an error code
- */
 errno_t ui_menu_paint(ui_menu_t *menu, gfx_coord2_t *spos)
 {
@@ -365,4 +282,5 @@
 	ui_menu_entry_t *mentry;
 	ui_menu_geom_t geom;
+	gfx_rect_t bg_rect;
 	errno_t rc;
 
@@ -370,9 +288,21 @@
 	ui_menu_get_geom(menu, spos, &geom);
 
-	/* Paint menu frame and background */
-	if (res->textmode)
-		rc = ui_menu_paint_bg_text(menu, spos);
-	else
-		rc = ui_menu_paint_bg_gfx(menu, spos);
+	/* Paint menu frame */
+
+	rc = gfx_set_color(res->gc, res->wnd_face_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = ui_paint_outset_frame(res, &geom.outer_rect, &bg_rect);
+	if (rc != EOK)
+		goto error;
+
+	/* Paint menu background */
+
+	rc = gfx_set_color(res->gc, res->wnd_face_color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_fill_rect(res->gc, &bg_rect);
 	if (rc != EOK)
 		goto error;
Index: uspace/lib/ui/src/menuentry.c
===================================================================
--- uspace/lib/ui/src/menuentry.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/menuentry.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -349,22 +349,11 @@
 
 	if (mentry->separator) {
-		if (res->textmode) {
-			rect = geom.outer_rect;
-			rect.p0.x -= 1;
-			rect.p1.x += 1;
-
-			rc = ui_paint_text_hbrace(res, &rect, ui_box_single,
-			    res->wnd_face_color);
-			if (rc != EOK)
-				goto error;
-		} else {
-			rect.p0 = geom.caption_pos;
-			rect.p1.x = geom.shortcut_pos.x;
-			rect.p1.y = rect.p0.y + 2;
-			rc = ui_paint_bevel(res->gc, &rect, res->wnd_shadow_color,
-			    res->wnd_highlight_color, 1, NULL);
-			if (rc != EOK)
-				goto error;
-		}
+		rect.p0 = geom.caption_pos;
+		rect.p1.x = geom.shortcut_pos.x;
+		rect.p1.y = rect.p0.y + 2;
+		rc = ui_paint_bevel(res->gc, &rect, res->wnd_shadow_color,
+		    res->wnd_highlight_color, 1, NULL);
+		if (rc != EOK)
+			goto error;
 	}
 
Index: uspace/lib/ui/src/msgdialog.c
===================================================================
--- uspace/lib/ui/src/msgdialog.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/msgdialog.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -103,5 +103,5 @@
 		wparams.rect.p0.x = 0;
 		wparams.rect.p0.y = 0;
-		wparams.rect.p1.x = 40;
+		wparams.rect.p1.x = 20;
 		wparams.rect.p1.y = 7;
 	} else {
@@ -177,5 +177,4 @@
 		goto error;
 
-	dialog->bok = bok;
 	bok = NULL;
 
@@ -188,9 +187,8 @@
 
 	dialog->window = window;
+	dialog->bok = bok;
 	*rdialog = dialog;
 	return EOK;
 error:
-	if (bok != NULL)
-		ui_pbutton_destroy(bok);
 	if (label != NULL)
 		ui_label_destroy(label);
Index: uspace/lib/ui/src/paint.c
===================================================================
--- uspace/lib/ui/src/paint.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/paint.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -38,41 +38,6 @@
 #include <gfx/context.h>
 #include <gfx/render.h>
-#include <gfx/text.h>
 #include <ui/paint.h>
-#include <stdlib.h>
-#include <str.h>
 #include "../private/resource.h"
-
-/** Single box characters */
-static ui_box_chars_t single_box_chars = {
-	{
-		{ "\u250c", "\u2500", "\u2510" },
-		{ "\u2502", " ",      "\u2502" },
-		{ "\u2514", "\u2500", "\u2518" }
-	}
-};
-
-/** Double box characters */
-static ui_box_chars_t double_box_chars = {
-	{
-		{ "\u2554", "\u2550", "\u2557" },
-		{ "\u2551", " ",      "\u2551" },
-		{ "\u255a", "\u2550", "\u255d" }
-	}
-};
-
-/** Single horizontal brace characters */
-static ui_brace_chars_t single_hbrace_chars = {
-	.start = "\u251c",
-	.middle = "\u2500",
-	.end = "\u2524"
-};
-
-/** Double horizontal brace characters */
-static ui_brace_chars_t double_hbrace_chars = {
-	.start = "\u2560",
-	.middle = "\u2550",
-	.end = "\u2563"
-};
 
 /** Paint bevel.
@@ -84,5 +49,5 @@
  * @param thickness Bevel thickness in pixels
  * @param inside Place to store rectangle of the interior or @c NULL
- * @return EOK on success or an error code
+ * @reutrn EOK on success or an error code
  */
 errno_t ui_paint_bevel(gfx_context_t *gc, gfx_rect_t *rect,
@@ -142,28 +107,14 @@
 	}
 
-	if (inside != NULL)
-		ui_paint_get_bevel_inside(gc, rect, thickness, inside);
+	if (inside != NULL) {
+		inside->p0.x = rect->p0.x + thickness;
+		inside->p0.y = rect->p0.y + thickness;
+		inside->p1.x = rect->p1.x - thickness;
+		inside->p1.y = rect->p1.y - thickness;
+	}
 
 	return EOK;
 error:
 	return rc;
-}
-
-/** Get bevel interior rectangle.
- *
- * Get the bevel interior rectangle without painting it.
- *
- * @param gc Graphic context
- * @param rect Rectangle to paint into
- * @param thickness Bevel thickness in pixels
- * @param inside Place to store rectangle of the interior
- */
-void ui_paint_get_bevel_inside(gfx_context_t *gc, gfx_rect_t *rect,
-    gfx_coord_t thickness, gfx_rect_t *inside)
-{
-	inside->p0.x = rect->p0.x + thickness;
-	inside->p0.y = rect->p0.y + thickness;
-	inside->p1.x = rect->p1.x - thickness;
-	inside->p1.y = rect->p1.y - thickness;
 }
 
@@ -196,19 +147,4 @@
 error:
 	return rc;
-}
-
-/** Get inset frame interior rectangle.
- *
- * This allows one to get the interior rectangle without actually painting
- * the inset frame.
- *
- * @param resource UI resource
- * @param rect Rectangle to paint onto
- * @param inside Place to store inside rectangle or @c NULL
- */
-void ui_paint_get_inset_frame_inside(ui_resource_t *resource, gfx_rect_t *rect,
-    gfx_rect_t *inside)
-{
-	ui_paint_get_bevel_inside(resource->gc, rect, 2, inside);
 }
 
@@ -359,199 +295,4 @@
 }
 
-/** Paint a text box.
- *
- * @param resource UI resource
- * @param rect Rectangle inside which to paint the box
- * @param style Box style
- * @param color Color
- * @return EOK on success or an error code
- */
-errno_t ui_paint_text_box(ui_resource_t *resource, gfx_rect_t *rect,
-    ui_box_style_t style, gfx_color_t *color)
-{
-	errno_t rc;
-	gfx_text_fmt_t fmt;
-	gfx_rect_t srect;
-	gfx_coord2_t pos;
-	gfx_coord2_t dim;
-	size_t bufsz;
-	size_t off;
-	int i;
-	gfx_coord_t y;
-	char *str = NULL;
-	ui_box_chars_t *boxc = NULL;
-
-	gfx_rect_points_sort(rect, &srect);
-	gfx_rect_dims(&srect, &dim);
-
-	/* Is rectangle large enough to hold box? */
-	if (dim.x < 2 || dim.y < 2)
-		return EOK;
-
-	switch (style) {
-	case ui_box_single:
-		boxc = &single_box_chars;
-		break;
-	case ui_box_double:
-		boxc = &double_box_chars;
-		break;
-	}
-
-	if (boxc == NULL)
-		return EINVAL;
-
-	gfx_text_fmt_init(&fmt);
-	fmt.color = color;
-
-	bufsz = str_size(boxc->c[0][0]) +
-	    str_size(boxc->c[0][1]) * (dim.x - 2) +
-	    str_size(boxc->c[0][2]) + 1;
-
-	str = malloc(bufsz);
-	if (str == NULL)
-		return ENOMEM;
-
-	/* Top edge and corners */
-
-	str_cpy(str, bufsz, boxc->c[0][0]);
-	off = str_size(boxc->c[0][0]);
-
-	for (i = 1; i < dim.x - 1; i++) {
-		str_cpy(str + off, bufsz - off, boxc->c[0][1]);
-		off += str_size(boxc->c[0][1]);
-	}
-
-	str_cpy(str + off, bufsz - off, boxc->c[0][2]);
-	off += str_size(boxc->c[0][2]);
-	str[off] = '\0';
-
-	pos = rect->p0;
-	rc = gfx_puttext(resource->font, &pos, &fmt, str);
-	if (rc != EOK)
-		goto error;
-
-	/* Vertical edges */
-	for (y = rect->p0.y + 1; y < rect->p1.y - 1; y++) {
-		pos.y = y;
-
-		pos.x = rect->p0.x;
-		rc = gfx_puttext(resource->font, &pos, &fmt,
-		    boxc->c[1][0]);
-		if (rc != EOK)
-			goto error;
-
-		pos.x = rect->p1.x - 1;
-		rc = gfx_puttext(resource->font, &pos, &fmt,
-		    boxc->c[1][2]);
-		if (rc != EOK)
-			goto error;
-	}
-
-	/* Bottom edge and corners */
-
-	str_cpy(str, bufsz, boxc->c[2][0]);
-	off = str_size(boxc->c[2][0]);
-
-	for (i = 1; i < dim.x - 1; i++) {
-		str_cpy(str + off, bufsz - off, boxc->c[2][1]);
-		off += str_size(boxc->c[2][1]);
-	}
-
-	str_cpy(str + off, bufsz - off, boxc->c[2][2]);
-	off += str_size(boxc->c[2][2]);
-	str[off] = '\0';
-
-	pos.x = rect->p0.x;
-	pos.y = rect->p1.y - 1;
-	rc = gfx_puttext(resource->font, &pos, &fmt, str);
-	if (rc != EOK)
-		goto error;
-
-	free(str);
-	return EOK;
-error:
-	if (str != NULL)
-		free(str);
-	return rc;
-}
-
-/** Paint a text horizontal brace.
- *
- * @param resource UI resource
- * @param rect Rectangle inside which to paint the brace (height should
- *             be 1).
- * @param style Box style
- * @param color Color
- * @return EOK on success or an error code
- */
-errno_t ui_paint_text_hbrace(ui_resource_t *resource, gfx_rect_t *rect,
-    ui_box_style_t style, gfx_color_t *color)
-{
-	errno_t rc;
-	gfx_text_fmt_t fmt;
-	gfx_rect_t srect;
-	gfx_coord2_t pos;
-	gfx_coord2_t dim;
-	size_t bufsz;
-	size_t off;
-	int i;
-	char *str = NULL;
-	ui_brace_chars_t *hbc = NULL;
-
-	gfx_rect_points_sort(rect, &srect);
-	gfx_rect_dims(&srect, &dim);
-
-	/* Is rectangle large enough to hold brace? */
-	if (dim.x < 2 || dim.y < 1)
-		return EOK;
-
-	switch (style) {
-	case ui_box_single:
-		hbc = &single_hbrace_chars;
-		break;
-	case ui_box_double:
-		hbc = &double_hbrace_chars;
-		break;
-	}
-
-	if (hbc == NULL)
-		return EINVAL;
-
-	gfx_text_fmt_init(&fmt);
-	fmt.color = color;
-
-	bufsz = str_size(hbc->start) +
-	    str_size(hbc->middle) * (dim.x - 2) +
-	    str_size(hbc->end) + 1;
-
-	str = malloc(bufsz);
-	if (str == NULL)
-		return ENOMEM;
-
-	str_cpy(str, bufsz, hbc->start);
-	off = str_size(hbc->start);
-
-	for (i = 1; i < dim.x - 1; i++) {
-		str_cpy(str + off, bufsz - off, hbc->middle);
-		off += str_size(hbc->middle);
-	}
-
-	str_cpy(str + off, bufsz - off, hbc->end);
-	off += str_size(hbc->end);
-	str[off] = '\0';
-
-	pos = rect->p0;
-	rc = gfx_puttext(resource->font, &pos, &fmt, str);
-	if (rc != EOK)
-		goto error;
-
-	free(str);
-	return EOK;
-error:
-	if (str != NULL)
-		free(str);
-	return rc;
-}
-
 /** @}
  */
Index: uspace/lib/ui/src/pbutton.c
===================================================================
--- uspace/lib/ui/src/pbutton.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/pbutton.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -366,5 +366,5 @@
 	rect.p1.y = pbutton->rect.p0.y + 1;
 
-	rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_face_color);
+	rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_highlight_color);
 	if (rc != EOK)
 		goto error;
Index: pace/lib/ui/src/promptdialog.c
===================================================================
--- uspace/lib/ui/src/promptdialog.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,382 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libui
- * @{
- */
-/**
- * @file Prompt dialog
- */
-
-#include <errno.h>
-#include <mem.h>
-#include <stdlib.h>
-#include <ui/entry.h>
-#include <ui/fixed.h>
-#include <ui/label.h>
-#include <ui/promptdialog.h>
-#include <ui/pbutton.h>
-#include <ui/resource.h>
-#include <ui/ui.h>
-#include <ui/window.h>
-#include "../private/promptdialog.h"
-
-static void ui_prompt_dialog_wnd_close(ui_window_t *, void *);
-static void ui_prompt_dialog_wnd_kbd(ui_window_t *, void *, kbd_event_t *);
-
-ui_window_cb_t ui_prompt_dialog_wnd_cb = {
-	.close = ui_prompt_dialog_wnd_close,
-	.kbd = ui_prompt_dialog_wnd_kbd
-};
-
-static void ui_prompt_dialog_bok_clicked(ui_pbutton_t *, void *);
-static void ui_prompt_dialog_bcancel_clicked(ui_pbutton_t *, void *);
-
-ui_pbutton_cb_t ui_prompt_dialog_bok_cb = {
-	.clicked = ui_prompt_dialog_bok_clicked
-};
-
-ui_pbutton_cb_t ui_prompt_dialog_bcancel_cb = {
-	.clicked = ui_prompt_dialog_bcancel_clicked
-};
-
-/** Initialize prompt dialog parameters structure.
- *
- * Prompt dialog parameters structure must always be initialized using
- * this function first.
- *
- * @param params Prompt dialog parameters structure
- */
-void ui_prompt_dialog_params_init(ui_prompt_dialog_params_t *params)
-{
-	memset(params, 0, sizeof(ui_prompt_dialog_params_t));
-	params->itext = "";
-}
-
-/** Create new prompt dialog.
- *
- * @param ui User interface
- * @param params Prompt dialog parameters
- * @param rdialog Place to store pointer to new dialog
- * @return EOK on success or an error code
- */
-errno_t ui_prompt_dialog_create(ui_t *ui, ui_prompt_dialog_params_t *params,
-    ui_prompt_dialog_t **rdialog)
-{
-	errno_t rc;
-	ui_prompt_dialog_t *dialog;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t wparams;
-	ui_fixed_t *fixed = NULL;
-	ui_label_t *label = NULL;
-	ui_entry_t *entry = NULL;
-	ui_pbutton_t *bok = NULL;
-	ui_pbutton_t *bcancel = NULL;
-	gfx_rect_t rect;
-	ui_resource_t *ui_res;
-
-	dialog = calloc(1, sizeof(ui_prompt_dialog_t));
-	if (dialog == NULL) {
-		rc = ENOMEM;
-		goto error;
-	}
-
-	ui_wnd_params_init(&wparams);
-	wparams.caption = params->caption;
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		wparams.rect.p0.x = 0;
-		wparams.rect.p0.y = 0;
-		wparams.rect.p1.x = 40;
-		wparams.rect.p1.y = 9;
-	} else {
-		wparams.rect.p0.x = 0;
-		wparams.rect.p0.y = 0;
-		wparams.rect.p1.x = 300;
-		wparams.rect.p1.y = 135;
-	}
-
-	rc = ui_window_create(ui, &wparams, &window);
-	if (rc != EOK)
-		goto error;
-
-	ui_window_set_cb(window, &ui_prompt_dialog_wnd_cb, dialog);
-
-	ui_res = ui_window_get_res(window);
-
-	rc = ui_fixed_create(&fixed);
-	if (rc != EOK)
-		goto error;
-
-	rc = ui_label_create(ui_res, params->prompt, &label);
-	if (rc != EOK)
-		goto error;
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 3;
-		rect.p0.y = 2;
-		rect.p1.x = 17;
-		rect.p1.y = 3;
-	} else {
-		rect.p0.x = 10;
-		rect.p0.y = 35;
-		rect.p1.x = 190;
-		rect.p1.y = 50;
-	}
-
-	ui_label_set_rect(label, &rect);
-
-	rc = ui_fixed_add(fixed, ui_label_ctl(label));
-	if (rc != EOK)
-		goto error;
-
-	label = NULL;
-
-	rc = ui_entry_create(window, params->itext, &entry);
-	if (rc != EOK)
-		goto error;
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 3;
-		rect.p0.y = 4;
-		rect.p1.x = 37;
-		rect.p1.y = 5;
-	} else {
-		rect.p0.x = 10;
-		rect.p0.y = 55;
-		rect.p1.x = 290;
-		rect.p1.y = 80;
-	}
-
-	ui_entry_set_rect(entry, &rect);
-
-	rc = ui_fixed_add(fixed, ui_entry_ctl(entry));
-	if (rc != EOK)
-		goto error;
-
-	ui_entry_activate(entry);
-
-	/* Select all */
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_end(entry, true);
-
-	dialog->ename = entry;
-	entry = NULL;
-
-	rc = ui_pbutton_create(ui_res, "OK", &bok);
-	if (rc != EOK)
-		goto error;
-
-	ui_pbutton_set_cb(bok, &ui_prompt_dialog_bok_cb, dialog);
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 10;
-		rect.p0.y = 6;
-		rect.p1.x = 20;
-		rect.p1.y = 7;
-	} else {
-		rect.p0.x = 55;
-		rect.p0.y = 90;
-		rect.p1.x = 145;
-		rect.p1.y = 118;
-	}
-
-	ui_pbutton_set_rect(bok, &rect);
-
-	ui_pbutton_set_default(bok, true);
-
-	rc = ui_fixed_add(fixed, ui_pbutton_ctl(bok));
-	if (rc != EOK)
-		goto error;
-
-	dialog->bok = bok;
-	bok = NULL;
-
-	rc = ui_pbutton_create(ui_res, "Cancel", &bcancel);
-	if (rc != EOK)
-		goto error;
-
-	ui_pbutton_set_cb(bcancel, &ui_prompt_dialog_bcancel_cb, dialog);
-
-	/* FIXME: Auto layout */
-	if (ui_is_textmode(ui)) {
-		rect.p0.x = 22;
-		rect.p0.y = 6;
-		rect.p1.x = 32;
-		rect.p1.y = 7;
-	} else {
-		rect.p0.x = 155;
-		rect.p0.y = 90;
-		rect.p1.x = 245;
-		rect.p1.y = 118;
-	}
-
-	ui_pbutton_set_rect(bcancel, &rect);
-
-	rc = ui_fixed_add(fixed, ui_pbutton_ctl(bcancel));
-	if (rc != EOK)
-		goto error;
-
-	dialog->bcancel = bcancel;
-	bcancel = NULL;
-
-	ui_window_add(window, ui_fixed_ctl(fixed));
-	fixed = NULL;
-
-	rc = ui_window_paint(window);
-	if (rc != EOK)
-		goto error;
-
-	dialog->window = window;
-	*rdialog = dialog;
-	return EOK;
-error:
-	if (entry != NULL)
-		ui_entry_destroy(entry);
-	if (bok != NULL)
-		ui_pbutton_destroy(bok);
-	if (bcancel != NULL)
-		ui_pbutton_destroy(bcancel);
-	if (label != NULL)
-		ui_label_destroy(label);
-	if (fixed != NULL)
-		ui_fixed_destroy(fixed);
-	if (window != NULL)
-		ui_window_destroy(window);
-	if (dialog != NULL)
-		free(dialog);
-	return rc;
-}
-
-/** Destroy prompt dialog.
- *
- * @param dialog Prompt dialog or @c NULL
- */
-void ui_prompt_dialog_destroy(ui_prompt_dialog_t *dialog)
-{
-	if (dialog == NULL)
-		return;
-
-	ui_window_destroy(dialog->window);
-	free(dialog);
-}
-
-/** Set mesage dialog callback.
- *
- * @param dialog Prompt dialog
- * @param cb Prompt dialog callbacks
- * @param arg Callback argument
- */
-void ui_prompt_dialog_set_cb(ui_prompt_dialog_t *dialog, ui_prompt_dialog_cb_t *cb,
-    void *arg)
-{
-	dialog->cb = cb;
-	dialog->arg = arg;
-}
-
-/** Prompt dialog window close handler.
- *
- * @param window Window
- * @param arg Argument (ui_prompt_dialog_t *)
- */
-static void ui_prompt_dialog_wnd_close(ui_window_t *window, void *arg)
-{
-	ui_prompt_dialog_t *dialog = (ui_prompt_dialog_t *) arg;
-
-	if (dialog->cb != NULL && dialog->cb->close != NULL)
-		dialog->cb->close(dialog, dialog->arg);
-}
-
-/** Prompt dialog window keyboard event handler.
- *
- * @param window Window
- * @param arg Argument (ui_prompt_dialog_t *)
- * @param event Keyboard event
- */
-static void ui_prompt_dialog_wnd_kbd(ui_window_t *window, void *arg,
-    kbd_event_t *event)
-{
-	ui_prompt_dialog_t *dialog = (ui_prompt_dialog_t *) arg;
-	const char *fname;
-
-	if (event->type == KEY_PRESS &&
-	    (event->mods & (KM_CTRL | KM_SHIFT | KM_ALT)) == 0) {
-		if (event->key == KC_ENTER) {
-			/* Confirm */
-			if (dialog->cb != NULL && dialog->cb->bok != NULL) {
-				fname = ui_entry_get_text(dialog->ename);
-				dialog->cb->bok(dialog, dialog->arg, fname);
-				return;
-			}
-		} else if (event->key == KC_ESCAPE) {
-			/* Cancel */
-			if (dialog->cb != NULL && dialog->cb->bcancel != NULL) {
-				dialog->cb->bcancel(dialog, dialog->arg);
-				return;
-			}
-		}
-	}
-
-	ui_window_def_kbd(window, event);
-}
-
-/** Prompt dialog OK button click handler.
- *
- * @param pbutton Push button
- * @param arg Argument (ui_prompt_dialog_t *)
- */
-static void ui_prompt_dialog_bok_clicked(ui_pbutton_t *pbutton, void *arg)
-{
-	ui_prompt_dialog_t *dialog = (ui_prompt_dialog_t *) arg;
-	const char *fname;
-
-	if (dialog->cb != NULL && dialog->cb->bok != NULL) {
-		fname = ui_entry_get_text(dialog->ename);
-		dialog->cb->bok(dialog, dialog->arg, fname);
-	}
-}
-
-/** Prompt dialog cancel button click handler.
- *
- * @param pbutton Push button
- * @param arg Argument (ui_prompt_dialog_t *)
- */
-static void ui_prompt_dialog_bcancel_clicked(ui_pbutton_t *pbutton, void *arg)
-{
-	ui_prompt_dialog_t *dialog = (ui_prompt_dialog_t *) arg;
-
-	if (dialog->cb != NULL && dialog->cb->bcancel != NULL)
-		dialog->cb->bcancel(dialog, dialog->arg);
-}
-
-/** @}
- */
Index: uspace/lib/ui/src/rbutton.c
===================================================================
--- uspace/lib/ui/src/rbutton.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/rbutton.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -186,10 +186,10 @@
 }
 
-/** Paint radio button in graphics mode.
+/** Paint radio button.
  *
  * @param rbutton Radio button
  * @return EOK on success or an error code
  */
-errno_t ui_rbutton_paint_gfx(ui_rbutton_t *rbutton)
+errno_t ui_rbutton_paint(ui_rbutton_t *rbutton)
 {
 	gfx_coord2_t pos;
@@ -202,5 +202,5 @@
 	center.y = rbutton->rect.p0.y + rbutton_oframe_r;
 
-	/* Paint radio button frame */
+	/* Paint rbutton frame */
 
 	rc = gfx_set_color(rbutton->group->res->gc,
@@ -244,5 +244,5 @@
 		goto error;
 
-	/* Paint radio button interior */
+	/* Paint rbutton interior */
 	depressed = rbutton->held && rbutton->inside;
 
@@ -296,67 +296,4 @@
 }
 
-/** Paint radio button in text mode.
- *
- * @param rbutton Radio button
- * @return EOK on success or an error code
- */
-errno_t ui_rbutton_paint_text(ui_rbutton_t *rbutton)
-{
-	gfx_coord2_t pos;
-	gfx_text_fmt_t fmt;
-	bool depressed;
-	errno_t rc;
-
-	/* Paint radio button */
-
-	depressed = rbutton->held && rbutton->inside;
-
-	pos.x = rbutton->rect.p0.x;
-	pos.y = rbutton->rect.p0.y;
-
-	gfx_text_fmt_init(&fmt);
-	fmt.color = depressed ? rbutton->group->res->entry_act_bg_color :
-	    rbutton->group->res->wnd_text_color;
-	fmt.halign = gfx_halign_left;
-	fmt.valign = gfx_valign_top;
-
-	rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt,
-	    rbutton->group->selected == rbutton ? "(\u2022)" : "( )");
-	if (rc != EOK)
-		goto error;
-
-	/* Paint radio button label */
-
-	pos.x += 4;
-
-	fmt.color = rbutton->group->res->wnd_text_color;
-
-	rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt,
-	    rbutton->caption);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_update(rbutton->group->res->gc);
-	if (rc != EOK)
-		goto error;
-
-	return EOK;
-error:
-	return rc;
-}
-
-/** Paint radio button.
- *
- * @param rbutton Radio button
- * @return EOK on success or an error code
- */
-errno_t ui_rbutton_paint(ui_rbutton_t *rbutton)
-{
-	if (rbutton->group->res->textmode)
-		return ui_rbutton_paint_text(rbutton);
-	else
-		return ui_rbutton_paint_gfx(rbutton);
-}
-
 /** Press down button.
  *
@@ -379,4 +316,6 @@
 void ui_rbutton_release(ui_rbutton_t *rbutton)
 {
+	ui_rbutton_t *old_selected;
+
 	if (!rbutton->held)
 		return;
@@ -386,5 +325,16 @@
 	if (rbutton->inside) {
 		/* Activate radio button */
-		ui_rbutton_select(rbutton);
+		old_selected = rbutton->group->selected;
+
+		if (old_selected != rbutton) {
+			rbutton->group->selected = rbutton;
+			ui_rbutton_paint(old_selected);
+		}
+
+		/* Repaint and notify */
+		(void) ui_rbutton_paint(rbutton);
+
+		if (old_selected != rbutton)
+			ui_rbutton_selected(rbutton);
 	}
 }
@@ -418,27 +368,5 @@
 }
 
-/** Select radio button.
- *
- * @param rbutton Radio button
- */
-void ui_rbutton_select(ui_rbutton_t *rbutton)
-{
-	ui_rbutton_t *old_selected;
-
-	old_selected = rbutton->group->selected;
-
-	if (old_selected != rbutton) {
-		rbutton->group->selected = rbutton;
-		ui_rbutton_paint(old_selected);
-	}
-
-	/* Repaint and notify */
-	(void) ui_rbutton_paint(rbutton);
-
-	if (old_selected != rbutton)
-		ui_rbutton_selected(rbutton);
-}
-
-/** Notify that button was selected.
+/** Button was selected.
  *
  * @param rbutton Radio button
Index: uspace/lib/ui/src/resource.c
===================================================================
--- uspace/lib/ui/src/resource.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/resource.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -47,11 +47,12 @@
 static const char *ui_typeface_path = "/data/font/helena.tpf";
 
-/** Create new UI resource in graphics mode.
+/** Create new UI resource.
  *
  * @param gc Graphic context
+ * @param textmode @c true if running in text mode
  * @param rresource Place to store pointer to new UI resource
  * @return EOK on success, ENOMEM if out of memory
  */
-static errno_t ui_resource_create_gfx(gfx_context_t *gc,
+errno_t ui_resource_create(gfx_context_t *gc, bool textmode,
     ui_resource_t **rresource)
 {
@@ -80,6 +81,4 @@
 	gfx_color_t *entry_bg_color = NULL;
 	gfx_color_t *entry_act_bg_color = NULL;
-	gfx_color_t *entry_sel_text_fg_color = NULL;
-	gfx_color_t *entry_sel_text_bg_color = NULL;
 	errno_t rc;
 
@@ -88,17 +87,28 @@
 		return ENOMEM;
 
-	rc = gfx_typeface_open(gc, ui_typeface_path, &tface);
-	if (rc != EOK)
-		goto error;
-
-	finfo = gfx_typeface_first_font(tface);
-	if (finfo == NULL) {
-		rc = EIO;
-		goto error;
+	if (textmode) {
+		/* Create dummy font for text mode */
+		rc = gfx_typeface_create(gc, &tface);
+		if (rc != EOK)
+			goto error;
+
+		rc = gfx_font_create_textmode(tface, &font);
+		if (rc != EOK)
+			goto error;
+	} else {
+		rc = gfx_typeface_open(gc, ui_typeface_path, &tface);
+		if (rc != EOK)
+			goto error;
+
+		finfo = gfx_typeface_first_font(tface);
+		if (finfo == NULL) {
+			rc = EIO;
+			goto error;
+		}
+
+		rc = gfx_font_open(finfo, &font);
+		if (rc != EOK)
+			goto error;
 	}
-
-	rc = gfx_font_open(finfo, &font);
-	if (rc != EOK)
-		goto error;
 
 	rc = gfx_color_new_rgb_i16(0, 0, 0, &btn_frame_color);
@@ -185,13 +195,4 @@
 
 	rc = gfx_color_new_rgb_i16(0xc8c8, 0xc8c8, 0xc8c8, &entry_act_bg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff,
-	    &entry_sel_text_fg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_rgb_i16(0, 0, 0xffff, &entry_sel_text_bg_color);
 	if (rc != EOK)
 		goto error;
@@ -200,5 +201,5 @@
 	resource->tface = tface;
 	resource->font = font;
-	resource->textmode = false;
+	resource->textmode = textmode;
 
 	resource->btn_frame_color = btn_frame_color;
@@ -225,6 +226,4 @@
 	resource->entry_bg_color = entry_bg_color;
 	resource->entry_act_bg_color = entry_act_bg_color;
-	resource->entry_sel_text_fg_color = entry_sel_text_fg_color;
-	resource->entry_sel_text_bg_color = entry_sel_text_bg_color;
 
 	*rresource = resource;
@@ -272,8 +271,4 @@
 	if (entry_bg_color != NULL)
 		gfx_color_delete(entry_bg_color);
-	if (entry_sel_text_fg_color != NULL)
-		gfx_color_delete(entry_sel_text_fg_color);
-	if (entry_sel_text_bg_color != NULL)
-		gfx_color_delete(entry_sel_text_bg_color);
 	if (entry_act_bg_color != NULL)
 		gfx_color_delete(entry_act_bg_color);
@@ -283,245 +278,4 @@
 	free(resource);
 	return rc;
-}
-
-/** Create new UI resource in text mode.
- *
- * @param gc Graphic context
- * @param rresource Place to store pointer to new UI resource
- * @return EOK on success, ENOMEM if out of memory
- */
-static errno_t ui_resource_create_text(gfx_context_t *gc,
-    ui_resource_t **rresource)
-{
-	ui_resource_t *resource;
-	gfx_typeface_t *tface = NULL;
-	gfx_font_t *font = NULL;
-	gfx_color_t *btn_frame_color = NULL;
-	gfx_color_t *btn_face_color = NULL;
-	gfx_color_t *btn_text_color = NULL;
-	gfx_color_t *btn_highlight_color = NULL;
-	gfx_color_t *btn_shadow_color = NULL;
-	gfx_color_t *wnd_face_color = NULL;
-	gfx_color_t *wnd_text_color = NULL;
-	gfx_color_t *wnd_sel_text_color = NULL;
-	gfx_color_t *wnd_sel_text_bg_color = NULL;
-	gfx_color_t *wnd_frame_hi_color = NULL;
-	gfx_color_t *wnd_frame_sh_color = NULL;
-	gfx_color_t *wnd_highlight_color = NULL;
-	gfx_color_t *wnd_shadow_color = NULL;
-	gfx_color_t *tbar_act_bg_color = NULL;
-	gfx_color_t *tbar_inact_bg_color = NULL;
-	gfx_color_t *tbar_act_text_color = NULL;
-	gfx_color_t *tbar_inact_text_color = NULL;
-	gfx_color_t *entry_fg_color = NULL;
-	gfx_color_t *entry_bg_color = NULL;
-	gfx_color_t *entry_sel_text_fg_color = NULL;
-	gfx_color_t *entry_sel_text_bg_color = NULL;
-	gfx_color_t *entry_act_bg_color = NULL;
-	errno_t rc;
-
-	resource = calloc(1, sizeof(ui_resource_t));
-	if (resource == NULL)
-		return ENOMEM;
-
-	/* Create dummy font for text mode */
-	rc = gfx_typeface_create(gc, &tface);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_font_create_textmode(tface, &font);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x07, &btn_frame_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x20, &btn_face_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x20, &btn_text_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x20, &btn_highlight_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x01, &btn_shadow_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x70, &wnd_face_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x70, &wnd_text_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x07, &wnd_sel_text_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x07, &wnd_sel_text_bg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x70, &wnd_frame_hi_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x01, &wnd_frame_sh_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x70, &wnd_highlight_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x01, &wnd_shadow_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x70, &tbar_act_bg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x70, &tbar_act_text_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x07, &tbar_inact_bg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x07, &tbar_inact_text_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x1b, &entry_fg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x1b, &entry_bg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x20, &entry_sel_text_fg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x20, &entry_sel_text_bg_color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x37, &entry_act_bg_color);
-	if (rc != EOK)
-		goto error;
-
-	resource->gc = gc;
-	resource->tface = tface;
-	resource->font = font;
-	resource->textmode = true;
-
-	resource->btn_frame_color = btn_frame_color;
-	resource->btn_face_color = btn_face_color;
-	resource->btn_text_color = btn_text_color;
-	resource->btn_highlight_color = btn_highlight_color;
-	resource->btn_shadow_color = btn_shadow_color;
-
-	resource->wnd_face_color = wnd_face_color;
-	resource->wnd_text_color = wnd_text_color;
-	resource->wnd_sel_text_color = wnd_sel_text_color;
-	resource->wnd_sel_text_bg_color = wnd_sel_text_bg_color;
-	resource->wnd_frame_hi_color = wnd_frame_hi_color;
-	resource->wnd_frame_sh_color = wnd_frame_sh_color;
-	resource->wnd_highlight_color = wnd_highlight_color;
-	resource->wnd_shadow_color = wnd_shadow_color;
-
-	resource->tbar_act_bg_color = tbar_act_bg_color;
-	resource->tbar_act_text_color = tbar_act_text_color;
-	resource->tbar_inact_bg_color = tbar_inact_bg_color;
-	resource->tbar_inact_text_color = tbar_inact_text_color;
-
-	resource->entry_fg_color = entry_fg_color;
-	resource->entry_bg_color = entry_bg_color;
-	resource->entry_act_bg_color = entry_act_bg_color;
-	resource->entry_sel_text_fg_color = entry_sel_text_fg_color;
-	resource->entry_sel_text_bg_color = entry_sel_text_bg_color;
-
-	*rresource = resource;
-	return EOK;
-error:
-	if (btn_frame_color != NULL)
-		gfx_color_delete(btn_frame_color);
-	if (btn_face_color != NULL)
-		gfx_color_delete(btn_face_color);
-	if (btn_text_color != NULL)
-		gfx_color_delete(btn_text_color);
-	if (btn_highlight_color != NULL)
-		gfx_color_delete(btn_highlight_color);
-	if (btn_shadow_color != NULL)
-		gfx_color_delete(btn_shadow_color);
-
-	if (wnd_face_color != NULL)
-		gfx_color_delete(wnd_face_color);
-	if (wnd_text_color != NULL)
-		gfx_color_delete(wnd_text_color);
-	if (wnd_sel_text_color != NULL)
-		gfx_color_delete(wnd_sel_text_color);
-	if (wnd_sel_text_bg_color != NULL)
-		gfx_color_delete(wnd_sel_text_bg_color);
-	if (wnd_frame_hi_color != NULL)
-		gfx_color_delete(wnd_frame_hi_color);
-	if (wnd_frame_sh_color != NULL)
-		gfx_color_delete(wnd_frame_sh_color);
-	if (wnd_highlight_color != NULL)
-		gfx_color_delete(wnd_highlight_color);
-	if (wnd_shadow_color != NULL)
-		gfx_color_delete(wnd_shadow_color);
-
-	if (tbar_act_bg_color != NULL)
-		gfx_color_delete(tbar_act_bg_color);
-	if (tbar_act_text_color != NULL)
-		gfx_color_delete(tbar_act_text_color);
-	if (tbar_inact_bg_color != NULL)
-		gfx_color_delete(tbar_inact_bg_color);
-	if (tbar_inact_text_color != NULL)
-		gfx_color_delete(tbar_inact_text_color);
-
-	if (entry_fg_color != NULL)
-		gfx_color_delete(entry_fg_color);
-	if (entry_bg_color != NULL)
-		gfx_color_delete(entry_bg_color);
-	if (entry_act_bg_color != NULL)
-		gfx_color_delete(entry_act_bg_color);
-	if (entry_sel_text_fg_color != NULL)
-		gfx_color_delete(entry_sel_text_fg_color);
-	if (entry_sel_text_bg_color != NULL)
-		gfx_color_delete(entry_sel_text_bg_color);
-
-	if (tface != NULL)
-		gfx_typeface_destroy(tface);
-	free(resource);
-	return rc;
-}
-
-/** Create new UI resource.
- *
- * @param gc Graphic context
- * @param textmode @c true if running in text mode
- * @param rresource Place to store pointer to new UI resource
- * @return EOK on success, ENOMEM if out of memory
- */
-errno_t ui_resource_create(gfx_context_t *gc, bool textmode,
-    ui_resource_t **rresource)
-{
-	if (textmode)
-		return ui_resource_create_text(gc, rresource);
-	else
-		return ui_resource_create_gfx(gc, rresource);
 }
 
@@ -558,6 +312,4 @@
 	gfx_color_delete(resource->entry_bg_color);
 	gfx_color_delete(resource->entry_act_bg_color);
-	gfx_color_delete(resource->entry_sel_text_fg_color);
-	gfx_color_delete(resource->entry_sel_text_bg_color);
 
 	gfx_font_close(resource->font);
@@ -594,14 +346,4 @@
 }
 
-/** Get the UI font.
- *
- * @param resource UI resource
- * @return UI font
- */
-gfx_font_t *ui_resource_get_font(ui_resource_t *resource)
-{
-	return resource->font;
-}
-
 /** @}
  */
Index: uspace/lib/ui/src/slider.c
===================================================================
--- uspace/lib/ui/src/slider.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/slider.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -38,5 +38,4 @@
 #include <gfx/context.h>
 #include <gfx/render.h>
-#include <gfx/text.h>
 #include <io/pos_event.h>
 #include <stdlib.h>
@@ -58,6 +57,4 @@
 	/** Slider button height */
 	ui_slider_btn_h = 23,
-	/** Slider button width in text mode */
-	ui_slider_btn_w_text = 3,
 	/** Slider button frame thickness */
 	ui_slider_btn_frame_thickness = 1,
@@ -254,18 +251,15 @@
 {
 	gfx_coord2_t dims;
-	gfx_coord_t w;
 
 	gfx_rect_dims(&slider->rect, &dims);
-	w = slider->res->textmode ? ui_slider_btn_w_text :
-	    ui_slider_btn_w;
-	return dims.x - w;
-}
-
-/** Paint slider in graphics mode.
+	return dims.x - ui_slider_btn_w;
+}
+
+/** Paint slider.
  *
  * @param slider Slider
  * @return EOK on success or an error code
  */
-errno_t ui_slider_paint_gfx(ui_slider_t *slider)
+errno_t ui_slider_paint(ui_slider_t *slider)
 {
 	gfx_coord2_t pos;
@@ -321,76 +315,4 @@
 }
 
-/** Paint slider in text mode.
- *
- * @param slider Slider
- * @return EOK on success or an error code
- */
-errno_t ui_slider_paint_text(ui_slider_t *slider)
-{
-	gfx_coord2_t pos;
-	gfx_text_fmt_t fmt;
-	gfx_coord_t w, i;
-	char *buf;
-	const char *gchar;
-	size_t gcharsz;
-	errno_t rc;
-
-	/* Paint slider groove */
-
-	pos = slider->rect.p0;
-
-	gfx_text_fmt_init(&fmt);
-	fmt.color = slider->res->wnd_text_color;
-	fmt.halign = gfx_halign_left;
-	fmt.valign = gfx_valign_top;
-
-	w = slider->rect.p1.x - slider->rect.p0.x;
-	gchar = "\u2550";
-	gcharsz = str_size(gchar);
-
-	buf = malloc(w * gcharsz + 1);
-	if (buf == NULL)
-		return ENOMEM;
-
-	for (i = 0; i < w; i++)
-		str_cpy(buf + i * gcharsz, (w - i) * gcharsz + 1, gchar);
-	buf[w * gcharsz] = '\0';
-
-	rc = gfx_puttext(slider->res->font, &pos, &fmt, buf);
-	free(buf);
-	if (rc != EOK)
-		goto error;
-
-	/* Paint slider button */
-
-	pos.x += slider->pos;
-
-	rc = gfx_puttext(slider->res->font, &pos, &fmt,
-	    "[O]");
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_update(slider->res->gc);
-	if (rc != EOK)
-		goto error;
-
-	return EOK;
-error:
-	return rc;
-}
-
-/** Paint slider.
- *
- * @param slider Slider
- * @return EOK on success or an error code
- */
-errno_t ui_slider_paint(ui_slider_t *slider)
-{
-	if (slider->res->textmode)
-		return ui_slider_paint_text(slider);
-	else
-		return ui_slider_paint_gfx(slider);
-}
-
 /** Clear slider button.
  *
@@ -402,8 +324,4 @@
 	gfx_rect_t rect;
 	errno_t rc;
-
-	/* No need to clear button in text mode */
-	if (slider->res->textmode)
-		return EOK;
 
 	ui_slider_btn_rect(slider, &rect);
Index: uspace/lib/ui/src/ui.c
===================================================================
--- uspace/lib/ui/src/ui.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/ui.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -39,6 +39,4 @@
 #include <errno.h>
 #include <fibril.h>
-#include <gfx/color.h>
-#include <gfx/render.h>
 #include <io/console.h>
 #include <stdbool.h>
@@ -55,6 +53,6 @@
  *
  * Output specification has the form <proto>@<service> where proto is
- * eiher 'disp' for display service, 'cons' for console, 'null'
- * for dummy output. Service is a location ID service name (e.g. hid/display).
+ * eiher 'disp' for display service or 'cons' for console. Service
+ * is a location ID service name (e.g. hid/display).
  *
  * @param ospec Output specification
@@ -82,6 +80,4 @@
 		} else if (str_lcmp(ospec, "cons@", str_length("cons@")) == 0) {
 			*ws = ui_ws_console;
-		} else if (str_lcmp(ospec, "null@", str_length("null@")) == 0) {
-			*ws = ui_ws_null;
 		} else {
 			*ws = ui_ws_unknown;
@@ -101,7 +97,5 @@
  *
  * @param ospec Output specification or @c UI_DISPLAY_DEFAULT to use
- *              the default display service, UI_CONSOLE_DEFAULT to use
- *		the default console service, UI_DISPLAY_NULL to use
- *		dummy output.
+ *              the default output
  * @param rui Place to store pointer to new UI
  * @return EOK on success or an error code
@@ -115,6 +109,4 @@
 	ui_winsys_t ws;
 	const char *osvc;
-	sysarg_t cols;
-	sysarg_t rows;
 	ui_t *ui;
 
@@ -135,12 +127,4 @@
 		if (console == NULL)
 			return EIO;
-
-		rc = console_get_size(console, &cols, &rows);
-		if (rc != EOK) {
-			console_done(console);
-			return rc;
-		}
-
-		console_cursor_visibility(console, false);
 
 		/* ws == ui_ws_console */
@@ -159,14 +143,4 @@
 
 		ui->cgc = cgc;
-		ui->rect.p0.x = 0;
-		ui->rect.p0.y = 0;
-		ui->rect.p1.x = cols;
-		ui->rect.p1.y = rows;
-
-		(void) ui_paint(ui);
-	} else if (ws == ui_ws_null) {
-		rc = ui_create_disp(NULL, &ui);
-		if (rc != EOK)
-			return rc;
 	} else {
 		return EINVAL;
@@ -229,8 +203,6 @@
 		if (ui->cgc != NULL)
 			console_gc_delete(ui->cgc);
-		if (ui->console != NULL) {
-			console_cursor_visibility(ui->console, true);
+		if (ui->console != NULL)
 			console_done(ui->console);
-		}
 		if (ui->display != NULL)
 			display_close(ui->display);
@@ -244,5 +216,4 @@
 	ui_window_t *awnd;
 	ui_evclaim_t claim;
-	pos_event_t pos;
 
 	awnd = ui_window_get_active(ui);
@@ -255,14 +226,8 @@
 		break;
 	case CEV_POS:
-		pos = event->ev.pos;
-		/* Translate event to window-relative coordinates */
-		pos.hpos -= awnd->dpos.x;
-		pos.vpos -= awnd->dpos.y;
-
-		claim = ui_wdecor_pos_event(awnd->wdecor, &pos);
+		claim = ui_wdecor_pos_event(awnd->wdecor, &event->ev.pos);
 		/* Note: If event is claimed, awnd might not be valid anymore */
 		if (claim == ui_unclaimed)
-			ui_window_send_pos(awnd, &pos);
-
+			ui_window_send_pos(awnd, &event->ev.pos);
 		break;
 	}
@@ -315,31 +280,5 @@
 {
 	errno_t rc;
-	gfx_context_t *gc;
 	ui_window_t *awnd;
-	gfx_color_t *color = NULL;
-
-	/* In case of null output */
-	if (ui->cgc == NULL)
-		return EOK;
-
-	gc = console_gc_get_ctx(ui->cgc);
-
-	rc = gfx_color_new_ega(0x11, &color);
-	if (rc != EOK)
-		return rc;
-
-	rc = gfx_set_color(gc, color);
-	if (rc != EOK) {
-		gfx_color_delete(color);
-		return rc;
-	}
-
-	rc = gfx_fill_rect(gc, &ui->rect);
-	if (rc != EOK) {
-		gfx_color_delete(color);
-		return rc;
-	}
-
-	gfx_color_delete(color);
 
 	/* XXX Should repaint all windows */
Index: uspace/lib/ui/src/wdecor.c
===================================================================
--- uspace/lib/ui/src/wdecor.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/wdecor.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -61,4 +61,5 @@
 	wdecor_edge_h = 4,
 	wdecor_tbar_h = 22,
+	wdecor_tbar_h_text = 1,
 	wdecor_frame_w = 4,
 	wdecor_frame_w_text = 1
@@ -169,5 +170,4 @@
 	gfx_rect_t rect;
 	gfx_rect_t trect;
-	gfx_rect_t text_rect;
 	gfx_text_fmt_t fmt;
 	gfx_coord2_t pos;
@@ -180,6 +180,7 @@
 
 		if (wdecor->res->textmode != false) {
-			rc = ui_paint_text_box(wdecor->res, &rect,
-			    ui_box_double, wdecor->res->wnd_face_color);
+			rc = ui_paint_bevel(wdecor->res->gc, &rect,
+			    wdecor->res->wnd_frame_hi_color,
+			    wdecor->res->wnd_frame_sh_color, 1, &rect);
 			if (rc != EOK)
 				return rc;
@@ -207,15 +208,15 @@
 			if (rc != EOK)
 				return rc;
-
-			rc = gfx_set_color(wdecor->res->gc, wdecor->active ?
-			    wdecor->res->tbar_act_bg_color :
-			    wdecor->res->tbar_inact_bg_color);
-			if (rc != EOK)
-				return rc;
-
-			rc = gfx_fill_rect(wdecor->res->gc, &trect);
-			if (rc != EOK)
-				return rc;
 		}
+
+		rc = gfx_set_color(wdecor->res->gc, wdecor->active ?
+		    wdecor->res->tbar_act_bg_color :
+		    wdecor->res->tbar_inact_bg_color);
+		if (rc != EOK)
+			return rc;
+
+		rc = gfx_fill_rect(wdecor->res->gc, &trect);
+		if (rc != EOK)
+			return rc;
 
 		gfx_text_fmt_init(&fmt);
@@ -229,26 +230,4 @@
 		pos.y = (trect.p0.y + trect.p1.y) / 2;
 
-		if (wdecor->res->textmode) {
-			/* Make space around caption text */
-			gfx_text_rect(wdecor->res->font, &pos, &fmt,
-			    wdecor->caption, &text_rect);
-
-			/* Only make space if caption is non-empty */
-			if (text_rect.p0.x < text_rect.p1.x) {
-				text_rect.p0.x -= 1;
-				text_rect.p1.x += 1;
-			}
-
-			rc = gfx_set_color(wdecor->res->gc, wdecor->active ?
-			    wdecor->res->tbar_act_bg_color :
-			    wdecor->res->tbar_inact_bg_color);
-			if (rc != EOK)
-				return rc;
-
-			rc = gfx_fill_rect(wdecor->res->gc, &text_rect);
-			if (rc != EOK)
-				return rc;
-		}
-
 		rc = gfx_puttext(wdecor->res->font, &pos, &fmt, wdecor->caption);
 		if (rc != EOK)
@@ -322,4 +301,5 @@
 {
 	gfx_coord_t frame_w;
+	gfx_coord_t tbar_h;
 
 	/* Does window have a frame? */
@@ -338,14 +318,10 @@
 	/* Does window have a title bar? */
 	if ((wdecor->style & ui_wds_titlebar) != 0) {
-		if (wdecor->res->textmode) {
-			geom->title_bar_rect.p0 = wdecor->rect.p0;
-			geom->title_bar_rect.p1.x = wdecor->rect.p1.x;
-			geom->title_bar_rect.p1.y = wdecor->rect.p0.y + 1;
-		} else {
-			geom->title_bar_rect.p0 = geom->interior_rect.p0;
-			geom->title_bar_rect.p1.x = geom->interior_rect.p1.x;
-			geom->title_bar_rect.p1.y = geom->interior_rect.p0.y +
-			    wdecor_tbar_h;
-		}
+		tbar_h = wdecor->res->textmode ?
+		    wdecor_tbar_h_text : wdecor_tbar_h;
+
+		geom->title_bar_rect.p0 = geom->interior_rect.p0;
+		geom->title_bar_rect.p1.x = geom->interior_rect.p1.x;
+		geom->title_bar_rect.p1.y = geom->interior_rect.p0.y + tbar_h;
 
 		geom->app_area_rect.p0.x = geom->interior_rect.p0.x;
Index: uspace/lib/ui/src/window.c
===================================================================
--- uspace/lib/ui/src/window.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/src/window.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -39,5 +39,4 @@
 #include <gfx/bitmap.h>
 #include <gfx/context.h>
-#include <gfx/cursor.h>
 #include <gfx/render.h>
 #include <io/kbd_event.h>
@@ -89,26 +88,6 @@
 static void ui_window_invalidate(void *, gfx_rect_t *);
 static void ui_window_update(void *);
-static errno_t ui_window_cursor_get_pos(void *, gfx_coord2_t *);
-static errno_t ui_window_cursor_set_pos(void *, gfx_coord2_t *);
-static errno_t ui_window_cursor_set_visible(void *, bool);
-
-/** Window memory GC callbacks */
-static mem_gc_cb_t ui_window_mem_gc_cb = {
-	.invalidate = ui_window_invalidate,
-	.update = ui_window_update,
-	.cursor_get_pos = ui_window_cursor_get_pos,
-	.cursor_set_pos = ui_window_cursor_set_pos,
-	.cursor_set_visible = ui_window_cursor_set_visible
-};
-
 static void ui_window_app_invalidate(void *, gfx_rect_t *);
 static void ui_window_app_update(void *);
-
-/** Application area memory GC callbacks */
-static mem_gc_cb_t ui_window_app_mem_gc_cb = {
-	.invalidate = ui_window_app_invalidate,
-	.update = ui_window_app_update
-};
-
 static void ui_window_expose_cb(void *);
 
@@ -132,19 +111,16 @@
 /** Compute where window should be placed on the screen.
  *
- * This only applies to windows that do not use default placement or
- * if we are running in full-screen mode.
- *
- * @param window Window
- * @param drect Display rectangle
+ * This only applies to windows that do not use default placement.
+ *
+ * @param window Window
+ * @param display Display
+ * @param info Display info
  * @param params Window parameters
  * @param pos Place to store position of top-left corner
  */
-static void ui_window_place(ui_window_t *window, gfx_rect_t *drect,
-    ui_wnd_params_t *params, gfx_coord2_t *pos)
-{
-	gfx_coord2_t dims;
-
-	assert(params->placement != ui_wnd_place_default ||
-	    ui_is_fullscreen(window->ui));
+static void ui_window_place(ui_window_t *window, display_t *display,
+    display_info_t *info, ui_wnd_params_t *params, gfx_coord2_t *pos)
+{
+	assert(params->placement != ui_wnd_place_default);
 
 	pos->x = 0;
@@ -153,26 +129,21 @@
 	switch (params->placement) {
 	case ui_wnd_place_default:
-		assert(ui_is_fullscreen(window->ui));
-		/* Center window */
-		gfx_rect_dims(&params->rect, &dims);
-		pos->x = (drect->p0.x + drect->p1.x) / 2 - dims.x / 2;
-		pos->y = (drect->p0.y + drect->p1.y) / 2 - dims.y / 2;
-		break;
+		assert(false);
 	case ui_wnd_place_top_left:
 	case ui_wnd_place_full_screen:
-		pos->x = drect->p0.x - params->rect.p0.x;
-		pos->y = drect->p0.y - params->rect.p0.y;
+		pos->x = info->rect.p0.x - params->rect.p0.x;
+		pos->y = info->rect.p0.y - params->rect.p0.y;
 		break;
 	case ui_wnd_place_top_right:
-		pos->x = drect->p1.x - params->rect.p1.x;
-		pos->y = drect->p0.y - params->rect.p0.y;
+		pos->x = info->rect.p1.x - params->rect.p1.x;
+		pos->y = info->rect.p0.y - params->rect.p0.y;
 		break;
 	case ui_wnd_place_bottom_left:
-		pos->x = drect->p0.x - params->rect.p0.x;
-		pos->y = drect->p1.y - params->rect.p1.y;
+		pos->x = info->rect.p0.x - params->rect.p0.x;
+		pos->y = info->rect.p1.y - params->rect.p1.y;
 		break;
 	case ui_wnd_place_bottom_right:
-		pos->x = drect->p1.x - params->rect.p1.x;
-		pos->y = drect->p1.y - params->rect.p1.y;
+		pos->x = info->rect.p1.x - params->rect.p1.x;
+		pos->y = info->rect.p1.y - params->rect.p1.y;
 		break;
 	case ui_wnd_place_popup:
@@ -205,7 +176,5 @@
 	gfx_bitmap_alloc_t alloc;
 	gfx_bitmap_t *bmp = NULL;
-	gfx_coord2_t off;
 	mem_gc_t *memgc = NULL;
-	xlate_gc_t *xgc = NULL;
 	errno_t rc;
 
@@ -213,6 +182,4 @@
 	if (window == NULL)
 		return ENOMEM;
-
-	window->ui = ui;
 
 	display_wnd_params_init(&dparams);
@@ -240,6 +207,6 @@
 		if (params->placement != ui_wnd_place_default) {
 			/* Set initial display window position */
-			ui_window_place(window, &info.rect, params,
-			    &dparams.pos);
+			ui_window_place(window, ui->display, &info,
+			    params, &dparams.pos);
 
 			dparams.flags |= wndf_setpos;
@@ -256,11 +223,4 @@
 	} else if (ui->console != NULL) {
 		gc = console_gc_get_ctx(ui->cgc);
-
-		if (params->placement == ui_wnd_place_full_screen) {
-			/* Make window the size of the screen */
-			gfx_rect_dims(&ui->rect, &scr_dims);
-			gfx_coord2_add(&dparams.rect.p0, &scr_dims,
-			    &dparams.rect.p1);
-		}
 	} else {
 		/* Needed for unit tests */
@@ -282,5 +242,5 @@
 
 	/* Move rectangle so that top-left corner is 0,0 */
-	gfx_rect_rtranslate(&dparams.rect.p0, &dparams.rect, &bparams.rect);
+	gfx_rect_rtranslate(&params->rect.p0, &params->rect, &bparams.rect);
 
 	rc = gfx_bitmap_create(gc, &bparams, NULL, &bmp);
@@ -295,6 +255,6 @@
 	}
 
-	rc = mem_gc_create(&bparams.rect, &alloc, &ui_window_mem_gc_cb,
-	    (void *) window, &memgc);
+	rc = mem_gc_create(&bparams.rect, &alloc, ui_window_invalidate,
+	    ui_window_update, (void *) window, &memgc);
 	if (rc != EOK) {
 		gfx_bitmap_destroy(window->app_bmp);
@@ -306,34 +266,11 @@
 	window->gc = mem_gc_get_ctx(memgc);
 	window->realgc = gc;
-	(void) off;
 #else
-	/* Server-side rendering */
-
-	/* Full-screen mode? */
-	if (ui->display == NULL) {
-		/* Create translating GC to translate window contents */
-		off.x = 0;
-		off.y = 0;
-		rc = xlate_gc_create(&off, gc, &xgc);
-		if (rc != EOK)
-			goto error;
-
-		window->xgc = xgc;
-		window->gc = xlate_gc_get_ctx(xgc);
-		window->realgc = gc;
-	} else {
-		window->gc = gc;
-	}
-
-	(void) ui_window_mem_gc_cb;
+	(void) ui_window_update;
+	(void) ui_window_invalidate;
 	(void) alloc;
 	(void) bparams;
+	window->gc = gc;
 #endif
-	if (ui->display == NULL) {
-		ui_window_place(window, &ui->rect, params, &window->dpos);
-
-		if (window->xgc != NULL)
-			xlate_gc_set_off(window->xgc, &window->dpos);
-	}
 
 	rc = ui_resource_create(window->gc, ui_is_textmode(ui), &res);
@@ -351,5 +288,7 @@
 	ui_resource_set_expose_cb(res, ui_window_expose_cb, (void *) window);
 
+	window->ui = ui;
 	window->rect = dparams.rect;
+
 	window->res = res;
 	window->wdecor = wdecor;
@@ -366,6 +305,4 @@
 	if (memgc != NULL)
 		mem_gc_delete(memgc);
-	if (xgc != NULL)
-		xlate_gc_delete(xgc);
 	if (bmp != NULL)
 		gfx_bitmap_destroy(bmp);
@@ -403,4 +340,5 @@
 	if (window->bmp != NULL)
 		gfx_bitmap_destroy(window->bmp);
+	gfx_context_delete(window->gc);
 	if (window->dwindow != NULL)
 		display_window_destroy(window->dwindow);
@@ -601,14 +539,4 @@
 }
 
-/** Get window's containing UI.
- *
- * @param window Window
- * @return Containing UI
- */
-ui_t *ui_window_get_ui(ui_window_t *window)
-{
-	return window->ui;
-}
-
 /** Get UI resource from window.
  *
@@ -646,5 +574,6 @@
 			return rc;
 	} else {
-		*pos = window->dpos;
+		pos->x = 0;
+		pos->y = 0;
 	}
 
@@ -689,6 +618,6 @@
 		}
 
-		rc = mem_gc_create(&params.rect, &alloc,
-		    &ui_window_app_mem_gc_cb, (void *) window, &memgc);
+		rc = mem_gc_create(&params.rect, &alloc, ui_window_app_invalidate,
+		    ui_window_app_update, (void *) window, &memgc);
 		if (rc != EOK) {
 			gfx_bitmap_destroy(window->app_bmp);
@@ -942,6 +871,4 @@
 	if (window->cb != NULL && window->cb->kbd != NULL)
 		window->cb->kbd(window, window->arg, kbd);
-	else
-		return ui_window_def_kbd(window, kbd);
 }
 
@@ -982,14 +909,4 @@
 }
 
-/** Default window keyboard event routine.
- *
- * @param window Window
- */
-void ui_window_def_kbd(ui_window_t *window, kbd_event_t *kbd)
-{
-	if (window->control != NULL)
-		ui_control_kbd_event(window->control, kbd);
-}
-
 /** Default window paint routine.
  *
@@ -1065,8 +982,6 @@
 	ui_window_t *window = (ui_window_t *) arg;
 
-	if (!gfx_rect_is_empty(&window->dirty_rect)) {
-		(void) gfx_bitmap_render(window->bmp, &window->dirty_rect,
-		    &window->dpos);
-	}
+	if (!gfx_rect_is_empty(&window->dirty_rect))
+		(void) gfx_bitmap_render(window->bmp, &window->dirty_rect, NULL);
 
 	window->dirty_rect.p0.x = 0;
@@ -1074,52 +989,4 @@
 	window->dirty_rect.p1.x = 0;
 	window->dirty_rect.p1.y = 0;
-}
-
-/** Window cursor get position callback
- *
- * @param arg Argument (ui_window_t *)
- * @param pos Place to store position
- */
-static errno_t ui_window_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	ui_window_t *window = (ui_window_t *) arg;
-	gfx_coord2_t cpos;
-	errno_t rc;
-
-	rc = gfx_cursor_get_pos(window->realgc, &cpos);
-	if (rc != EOK)
-		return rc;
-
-	pos->x = cpos.x - window->dpos.x;
-	pos->y = cpos.y - window->dpos.y;
-	return EOK;
-}
-
-/** Window cursor set position callback
- *
- * @param arg Argument (ui_window_t *)
- * @param pos New position
- */
-static errno_t ui_window_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	ui_window_t *window = (ui_window_t *) arg;
-	gfx_coord2_t cpos;
-
-	cpos.x = pos->x + window->dpos.x;
-	cpos.y = pos->y + window->dpos.y;
-
-	return gfx_cursor_set_pos(window->realgc, &cpos);
-}
-
-/** Window cursor set visibility callback
- *
- * @param arg Argument (ui_window_t *)
- * @param visible @c true iff cursor is to be made visible
- */
-static errno_t ui_window_cursor_set_visible(void *arg, bool visible)
-{
-	ui_window_t *window = (ui_window_t *) arg;
-
-	return gfx_cursor_set_visible(window->realgc, visible);
 }
 
Index: uspace/lib/ui/test/checkbox.c
===================================================================
--- uspace/lib/ui/test/checkbox.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/checkbox.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -151,6 +151,6 @@
 }
 
-/** Paint check box in graphics mode */
-PCUT_TEST(paint_gfx)
+/** Paint check box */
+PCUT_TEST(paint)
 {
 	errno_t rc;
@@ -171,35 +171,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = ui_checkbox_paint_gfx(checkbox);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_checkbox_destroy(checkbox);
-	ui_resource_destroy(resource);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Paint check box in text mode */
-PCUT_TEST(paint_text)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-	ui_resource_t *resource = NULL;
-	ui_checkbox_t *checkbox;
-
-	memset(&tgc, 0, sizeof(tgc));
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_resource_create(gc, false, &resource);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(resource);
-
-	rc = ui_checkbox_create(resource, "Hello", &checkbox);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_checkbox_paint_text(checkbox);
+	rc = ui_checkbox_paint(checkbox);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
Index: uspace/lib/ui/test/control.c
===================================================================
--- uspace/lib/ui/test/control.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/control.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2020 Jiri Svoboda
  * All rights reserved.
  *
@@ -29,5 +29,4 @@
 #include <errno.h>
 #include <mem.h>
-#include <io/kbd_event.h>
 #include <io/pos_event.h>
 #include <pcut/pcut.h>
@@ -42,5 +41,4 @@
 static void test_ctl_destroy(void *);
 static errno_t test_ctl_paint(void *);
-static ui_evclaim_t test_ctl_kbd_event(void *, kbd_event_t *);
 static ui_evclaim_t test_ctl_pos_event(void *, pos_event_t *);
 static void test_ctl_unfocus(void *);
@@ -49,5 +47,4 @@
 	.destroy = test_ctl_destroy,
 	.paint = test_ctl_paint,
-	.kbd_event = test_ctl_kbd_event,
 	.pos_event = test_ctl_pos_event,
 	.unfocus = test_ctl_unfocus
@@ -67,9 +64,4 @@
 	bool paint;
 
-	/** @c true iff kbd_event was called */
-	bool kbd;
-	/** Keyboard event that was sent */
-	kbd_event_t kevent;
-
 	/** @c true iff pos_event was called */
 	bool pos;
@@ -142,35 +134,4 @@
 	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
 	PCUT_ASSERT_TRUE(resp.paint);
-
-	ui_control_delete(control);
-}
-
-/** Test sending keyboard event to control */
-PCUT_TEST(kbd_event)
-{
-	ui_control_t *control = NULL;
-	test_resp_t resp;
-	kbd_event_t event;
-	ui_evclaim_t claim;
-	errno_t rc;
-
-	rc = ui_control_new(&test_ctl_ops, &resp, &control);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(control);
-
-	resp.claim = ui_claimed;
-	resp.kbd = false;
-	event.type = KEY_PRESS;
-	event.key = KC_2;
-	event.mods = KM_LSHIFT;
-	event.c = '@';
-
-	claim = ui_control_kbd_event(control, &event);
-	PCUT_ASSERT_EQUALS(resp.claim, claim);
-	PCUT_ASSERT_TRUE(resp.kbd);
-	PCUT_ASSERT_EQUALS(resp.kevent.type, event.type);
-	PCUT_ASSERT_INT_EQUALS(resp.kevent.key, event.key);
-	PCUT_ASSERT_INT_EQUALS(resp.kevent.mods, event.mods);
-	PCUT_ASSERT_INT_EQUALS(resp.kevent.c, event.c);
 
 	ui_control_delete(control);
@@ -244,14 +205,4 @@
 }
 
-static ui_evclaim_t test_ctl_kbd_event(void *arg, kbd_event_t *event)
-{
-	test_resp_t *resp = (test_resp_t *) arg;
-
-	resp->kbd = true;
-	resp->kevent = *event;
-
-	return resp->claim;
-}
-
 static ui_evclaim_t test_ctl_pos_event(void *arg, pos_event_t *event)
 {
Index: uspace/lib/ui/test/entry.c
===================================================================
--- uspace/lib/ui/test/entry.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/entry.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -27,5 +27,4 @@
  */
 
-#include <clipboard.h>
 #include <gfx/context.h>
 #include <gfx/coord.h>
@@ -120,21 +119,4 @@
 }
 
-/** Set entry read only flag sets internal field */
-PCUT_TEST(set_read_only)
-{
-	ui_entry_t *entry;
-	errno_t rc;
-
-	rc = ui_entry_create(NULL, "Hello", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_entry_set_read_only(entry, true);
-	PCUT_ASSERT_TRUE(entry->read_only);
-	ui_entry_set_read_only(entry, false);
-	PCUT_ASSERT_FALSE(entry->read_only);
-
-	ui_entry_destroy(entry);
-}
-
 /** Set text entry rectangle sets internal field */
 PCUT_TEST(set_text)
@@ -191,618 +173,3 @@
 }
 
-/** ui_entry_delete_sel() deletes selected text */
-PCUT_TEST(delete_sel)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCDEF", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCDEF", entry->text);
-
-	ui_entry_activate(entry);
-
-	/* Select all but first and last character */
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_next_char(entry, false);
-	ui_entry_seek_end(entry, true);
-	ui_entry_seek_prev_char(entry, true);
-
-	ui_entry_delete_sel(entry);
-
-	PCUT_ASSERT_STR_EQUALS("AF", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_insert_str() inserts string at cursor. */
-PCUT_TEST(insert_str)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "A", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("A", entry->text);
-
-	ui_entry_activate(entry);
-	ui_entry_seek_end(entry, false);
-
-	rc = ui_entry_insert_str(entry, "B");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("AB", entry->text);
-
-	rc = ui_entry_insert_str(entry, "EF");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABEF", entry->text);
-
-	entry->pos = 2;
-	entry->sel_start = 2;
-	rc = ui_entry_insert_str(entry, "CD");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCDEF", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_insert_str() deletes selection before inserting string */
-PCUT_TEST(insert_str_with_sel)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCDE", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCDE", entry->text);
-
-	/* Select all but the first and last character */
-	ui_entry_activate(entry);
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_next_char(entry, false);
-	ui_entry_seek_end(entry, true);
-	ui_entry_seek_prev_char(entry, true);
-
-	rc = ui_entry_insert_str(entry, "123");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("A123E", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_backspace() deletes character before cursor. */
-PCUT_TEST(backspace)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCD", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCD", entry->text);
-	entry->pos = 3;
-	entry->sel_start = 3;
-
-	ui_entry_backspace(entry);
-	PCUT_ASSERT_STR_EQUALS("ABD", entry->text);
-
-	ui_entry_backspace(entry);
-	PCUT_ASSERT_STR_EQUALS("AD", entry->text);
-
-	ui_entry_backspace(entry);
-	PCUT_ASSERT_STR_EQUALS("D", entry->text);
-
-	ui_entry_backspace(entry);
-	PCUT_ASSERT_STR_EQUALS("D", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_backspace() with selected text deletes selection. */
-PCUT_TEST(backspace_with_sel)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCDE", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCDE", entry->text);
-
-	/* Select all but the first and last character */
-	ui_entry_activate(entry);
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_next_char(entry, false);
-	ui_entry_seek_end(entry, true);
-	ui_entry_seek_prev_char(entry, true);
-
-	ui_entry_backspace(entry);
-
-	PCUT_ASSERT_STR_EQUALS("AE", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_delete() deletes character after cursor. */
-PCUT_TEST(delete)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCD", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCD", entry->text);
-	entry->pos = 1;
-	entry->sel_start = 1;
-
-	ui_entry_delete(entry);
-	PCUT_ASSERT_STR_EQUALS("ACD", entry->text);
-
-	ui_entry_delete(entry);
-	PCUT_ASSERT_STR_EQUALS("AD", entry->text);
-
-	ui_entry_delete(entry);
-	PCUT_ASSERT_STR_EQUALS("A", entry->text);
-
-	ui_entry_delete(entry);
-	PCUT_ASSERT_STR_EQUALS("A", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_delete() with selected text deletes selection. */
-PCUT_TEST(delete_with_sel)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCDE", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCDE", entry->text);
-
-	/* Select all but the first and last character */
-	ui_entry_activate(entry);
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_next_char(entry, false);
-	ui_entry_seek_end(entry, true);
-	ui_entry_seek_prev_char(entry, true);
-
-	ui_entry_delete(entry);
-
-	PCUT_ASSERT_STR_EQUALS("AE", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_copy() copies selected text to clipboard. */
-PCUT_TEST(copy)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-	char *str;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCDEF", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_entry_activate(entry);
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_next_char(entry, false);
-	ui_entry_seek_end(entry, true);
-	ui_entry_seek_prev_char(entry, true);
-
-	// FIXME: This is not safe unless we could create a private
-	// test clipboard
-
-	ui_entry_copy(entry);
-	rc = clipboard_get_str(&str);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_STR_EQUALS("BCDE", str);
-	PCUT_ASSERT_STR_EQUALS("ABCDEF", entry->text);
-	free(str);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_cut() cuts selected text to clipboard. */
-PCUT_TEST(cut)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-	char *str;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCDEF", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_entry_activate(entry);
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_next_char(entry, false);
-	ui_entry_seek_end(entry, true);
-	ui_entry_seek_prev_char(entry, true);
-
-	// FIXME: This is not safe unless we could create a private
-	// test clipboard
-
-	ui_entry_cut(entry);
-	rc = clipboard_get_str(&str);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_STR_EQUALS("BCDE", str);
-	PCUT_ASSERT_STR_EQUALS("AF", entry->text);
-	free(str);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_paste() pastes text from clipboard. */
-PCUT_TEST(paste)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "AB", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_entry_activate(entry);
-	ui_entry_seek_start(entry, false);
-	ui_entry_seek_next_char(entry, false);
-
-	// FIXME: This is not safe unless we could create a private
-	// test clipboard
-
-	rc = clipboard_put_str("123");
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_entry_paste(entry);
-	PCUT_ASSERT_STR_EQUALS("A123B", entry->text);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_seek_start() moves cursor to beginning of text */
-PCUT_TEST(seek_start)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCDEF", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_entry_activate(entry);
-
-	entry->pos = 2;
-	entry->sel_start = 2;
-
-	ui_entry_seek_start(entry, true);
-	PCUT_ASSERT_INT_EQUALS(0, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(2, entry->sel_start);
-
-	ui_entry_seek_start(entry, false);
-	PCUT_ASSERT_INT_EQUALS(0, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(0, entry->sel_start);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_seek_end() moves cursor to the end of text */
-PCUT_TEST(seek_end)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCD", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCD", entry->text);
-	entry->pos = 2;
-	entry->sel_start = 2;
-
-	ui_entry_seek_end(entry, true);
-	PCUT_ASSERT_INT_EQUALS(4, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(2, entry->sel_start);
-	ui_entry_seek_end(entry, false);
-	PCUT_ASSERT_INT_EQUALS(4, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(4, entry->sel_start);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_seek_prev_char() moves cursor to the previous character */
-PCUT_TEST(seek_prev_char)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCD", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCD", entry->text);
-	entry->pos = 3;
-	entry->sel_start = 3;
-
-	ui_entry_seek_prev_char(entry, true);
-	PCUT_ASSERT_INT_EQUALS(2, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(3, entry->sel_start);
-
-	ui_entry_seek_prev_char(entry, false);
-	PCUT_ASSERT_INT_EQUALS(1, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(1, entry->sel_start);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_seek_prev_char() moves cursor to the next character */
-PCUT_TEST(seek_next_char)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABCD", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_STR_EQUALS("ABCD", entry->text);
-	entry->pos = 1;
-	entry->sel_start = 1;
-
-	ui_entry_seek_next_char(entry, true);
-	PCUT_ASSERT_INT_EQUALS(2, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(1, entry->sel_start);
-	ui_entry_seek_next_char(entry, false);
-	PCUT_ASSERT_INT_EQUALS(3, entry->pos);
-	PCUT_ASSERT_INT_EQUALS(3, entry->sel_start);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** ui_entry_activate() / ui_entry_deactivate() */
-PCUT_TEST(activate_deactivate)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_entry_t *entry;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_entry_create(window, "ABC", &entry);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	PCUT_ASSERT_FALSE(entry->active);
-
-	ui_entry_activate(entry);
-	PCUT_ASSERT_TRUE(entry->active);
-
-	ui_entry_deactivate(entry);
-	PCUT_ASSERT_FALSE(entry->active);
-
-	ui_entry_destroy(entry);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
 PCUT_EXPORT(entry);
Index: pace/lib/ui/test/filedialog.c
===================================================================
--- uspace/lib/ui/test/filedialog.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,185 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <pcut/pcut.h>
-#include <stdbool.h>
-#include <ui/pbutton.h>
-#include <ui/ui.h>
-#include <ui/filedialog.h>
-#include "../private/filedialog.h"
-#include "../private/window.h"
-
-PCUT_INIT;
-
-PCUT_TEST_SUITE(file_dialog);
-
-static void test_dialog_bok(ui_file_dialog_t *, void *, const char *);
-static void test_dialog_bcancel(ui_file_dialog_t *, void *);
-static void test_dialog_close(ui_file_dialog_t *, void *);
-
-static ui_file_dialog_cb_t test_file_dialog_cb = {
-	.bok = test_dialog_bok,
-	.bcancel = test_dialog_bcancel,
-	.close = test_dialog_close
-};
-
-static ui_file_dialog_cb_t dummy_file_dialog_cb = {
-};
-
-typedef struct {
-	bool bok;
-	const char *fname;
-	bool bcancel;
-	bool close;
-} test_cb_resp_t;
-
-/** Create and destroy file dialog */
-PCUT_TEST(create_destroy)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_file_dialog_params_t params;
-	ui_file_dialog_t *dialog = NULL;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_file_dialog_params_init(&params);
-	params.caption = "Open";
-
-	rc = ui_file_dialog_create(ui, &params, &dialog);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(dialog);
-
-	ui_file_dialog_destroy(dialog);
-	ui_destroy(ui);
-}
-
-/** ui_file_dialog_destroy() can take NULL argument (no-op) */
-PCUT_TEST(destroy_null)
-{
-	ui_file_dialog_destroy(NULL);
-}
-
-/** Button click invokes callback set via ui_file_dialog_set_cb() */
-PCUT_TEST(button_cb)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_file_dialog_params_t params;
-	ui_file_dialog_t *dialog = NULL;
-	test_cb_resp_t resp;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_file_dialog_params_init(&params);
-	params.caption = "Open";
-
-	rc = ui_file_dialog_create(ui, &params, &dialog);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(dialog);
-
-	/* OK button callback with no callbacks set */
-	ui_pbutton_clicked(dialog->bok);
-
-	/* OK button callback with callback not implemented */
-	ui_file_dialog_set_cb(dialog, &dummy_file_dialog_cb, NULL);
-	ui_pbutton_clicked(dialog->bok);
-
-	/* OK button callback with real callback set */
-	resp.bok = false;
-	ui_file_dialog_set_cb(dialog, &test_file_dialog_cb, &resp);
-	ui_pbutton_clicked(dialog->bok);
-	PCUT_ASSERT_TRUE(resp.bok);
-
-	ui_file_dialog_destroy(dialog);
-	ui_destroy(ui);
-}
-
-/** Sending window close request invokes callback set via
- * ui_file_dialog_set_cb()
- */
-PCUT_TEST(close_cb)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_file_dialog_params_t params;
-	ui_file_dialog_t *dialog = NULL;
-	test_cb_resp_t resp;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_file_dialog_params_init(&params);
-	params.caption = "Open";
-
-	rc = ui_file_dialog_create(ui, &params, &dialog);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(dialog);
-
-	/* Button callback with no callbacks set */
-	ui_window_send_close(dialog->window);
-
-	/* Button callback with unfocus callback not implemented */
-	ui_file_dialog_set_cb(dialog, &dummy_file_dialog_cb, NULL);
-	ui_window_send_close(dialog->window);
-
-	/* Button callback with real callback set */
-	resp.close = false;
-	ui_file_dialog_set_cb(dialog, &test_file_dialog_cb, &resp);
-	ui_window_send_close(dialog->window);
-	PCUT_ASSERT_TRUE(resp.close);
-
-	ui_file_dialog_destroy(dialog);
-	ui_destroy(ui);
-}
-
-static void test_dialog_bok(ui_file_dialog_t *dialog, void *arg,
-    const char *fname)
-{
-	test_cb_resp_t *resp = (test_cb_resp_t *) arg;
-
-	resp->bok = true;
-}
-
-static void test_dialog_bcancel(ui_file_dialog_t *dialog, void *arg)
-{
-	test_cb_resp_t *resp = (test_cb_resp_t *) arg;
-
-	resp->bcancel = true;
-}
-
-static void test_dialog_close(ui_file_dialog_t *dialog, void *arg)
-{
-	test_cb_resp_t *resp = (test_cb_resp_t *) arg;
-
-	resp->close = true;
-}
-
-PCUT_EXPORT(file_dialog);
Index: uspace/lib/ui/test/main.c
===================================================================
--- uspace/lib/ui/test/main.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/main.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -34,5 +34,4 @@
 PCUT_IMPORT(checkbox);
 PCUT_IMPORT(entry);
-PCUT_IMPORT(file_dialog);
 PCUT_IMPORT(fixed);
 PCUT_IMPORT(image);
@@ -41,5 +40,4 @@
 PCUT_IMPORT(menubar);
 PCUT_IMPORT(menuentry);
-PCUT_IMPORT(msg_dialog);
 PCUT_IMPORT(paint);
 PCUT_IMPORT(pbutton);
Index: uspace/lib/ui/test/menu.c
===================================================================
--- uspace/lib/ui/test/menu.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/menu.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -209,102 +209,4 @@
 }
 
-/** Paint background in graphics mode */
-PCUT_TEST(paint_bg_gfx)
-{
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_menu_bar_t *mbar = NULL;
-	ui_menu_t *menu = NULL;
-	gfx_rect_t prect;
-	gfx_coord2_t pos;
-	errno_t rc;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_menu_bar_create(ui, window, &mbar);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(mbar);
-
-	rc = ui_menu_create(mbar, "Test", &menu);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(menu);
-
-	prect.p0.x = 0;
-	prect.p0.y = 0;
-	prect.p1.x = 0;
-	prect.p1.y = 0;
-
-	/* Menu needs to be open to be able to paint it */
-	rc = ui_menu_open(menu, &prect);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	pos.x = 0;
-	pos.y = 0;
-	rc = ui_menu_paint_bg_gfx(menu, &pos);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_menu_bar_destroy(mbar);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
-/** Paint background in text mode */
-PCUT_TEST(paint_bg_text)
-{
-	ui_t *ui = NULL;
-	ui_window_t *window = NULL;
-	ui_wnd_params_t params;
-	ui_menu_bar_t *mbar = NULL;
-	ui_menu_t *menu = NULL;
-	gfx_rect_t prect;
-	gfx_coord2_t pos;
-	errno_t rc;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rc = ui_menu_bar_create(ui, window, &mbar);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(mbar);
-
-	rc = ui_menu_create(mbar, "Test", &menu);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(menu);
-
-	prect.p0.x = 0;
-	prect.p0.y = 0;
-	prect.p1.x = 0;
-	prect.p1.y = 0;
-
-	/* Menu needs to be open to be able to paint it */
-	rc = ui_menu_open(menu, &prect);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	pos.x = 0;
-	pos.y = 0;
-	rc = ui_menu_paint_bg_text(menu, &pos);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_menu_bar_destroy(mbar);
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
 /** Paint menu */
 PCUT_TEST(paint)
Index: uspace/lib/ui/test/msgdialog.c
===================================================================
--- uspace/lib/ui/test/msgdialog.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/msgdialog.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -108,5 +108,5 @@
 	ui_pbutton_clicked(dialog->bok);
 
-	/* Button callback with callback not implemented */
+	/* Button callback with unfocus callback not implemented */
 	ui_msg_dialog_set_cb(dialog, &dummy_msg_dialog_cb, NULL);
 	ui_pbutton_clicked(dialog->bok);
Index: uspace/lib/ui/test/paint.c
===================================================================
--- uspace/lib/ui/test/paint.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/paint.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -96,9 +96,4 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rect.p0.x = 10;
-	rect.p0.y = 20;
-	rect.p1.x = 30;
-	rect.p1.y = 40;
-
 	/* Paint bevel with NULL 'inside' output parameter */
 	rc = ui_paint_bevel(gc, &rect, color1, color2, 2, NULL);
@@ -111,32 +106,4 @@
 	gfx_color_delete(color2);
 	gfx_color_delete(color1);
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Get bevel inside */
-PCUT_TEST(get_bevel_inside)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-	gfx_rect_t rect;
-	gfx_rect_t inside;
-
-	memset(&tgc, 0, sizeof(tgc));
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rect.p0.x = 10;
-	rect.p0.y = 20;
-	rect.p1.x = 30;
-	rect.p1.y = 40;
-
-	ui_paint_get_bevel_inside(gc, &rect, 2, &inside);
-	PCUT_ASSERT_INT_EQUALS(12, inside.p0.x);
-	PCUT_ASSERT_INT_EQUALS(22, inside.p0.y);
-	PCUT_ASSERT_INT_EQUALS(28, inside.p1.x);
-	PCUT_ASSERT_INT_EQUALS(38, inside.p1.y);
-
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -161,9 +128,4 @@
 	PCUT_ASSERT_NOT_NULL(resource);
 
-	rect.p0.x = 10;
-	rect.p0.y = 20;
-	rect.p1.x = 30;
-	rect.p1.y = 40;
-
 	/* Paint inset frame with NULL 'inside' output parameter */
 	rc = ui_paint_inset_frame(resource, &rect, NULL);
@@ -173,38 +135,4 @@
 	rc = ui_paint_inset_frame(resource, &rect, &inside);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_resource_destroy(resource);
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Get inset frame inside */
-PCUT_TEST(get_inset_frame_inside)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	ui_resource_t *resource = NULL;
-	test_gc_t tgc;
-	gfx_rect_t rect;
-	gfx_rect_t inside;
-
-	memset(&tgc, 0, sizeof(tgc));
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_resource_create(gc, false, &resource);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(resource);
-
-	rect.p0.x = 10;
-	rect.p0.y = 20;
-	rect.p1.x = 30;
-	rect.p1.y = 40;
-
-	ui_paint_get_inset_frame_inside(resource, &rect, &inside);
-	PCUT_ASSERT_INT_EQUALS(12, inside.p0.x);
-	PCUT_ASSERT_INT_EQUALS(22, inside.p0.y);
-	PCUT_ASSERT_INT_EQUALS(28, inside.p1.x);
-	PCUT_ASSERT_INT_EQUALS(38, inside.p1.y);
 
 	ui_resource_destroy(resource);
@@ -237,76 +165,4 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Paint text box */
-PCUT_TEST(text_box)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	ui_resource_t *resource = NULL;
-	gfx_color_t *color = NULL;
-	test_gc_t tgc;
-	gfx_rect_t rect;
-
-	memset(&tgc, 0, sizeof(tgc));
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_resource_create(gc, false, &resource);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(resource);
-
-	rc = gfx_color_new_rgb_i16(1, 2, 3, &color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rect.p0.x = 10;
-	rect.p0.y = 20;
-	rect.p1.x = 30;
-	rect.p1.y = 40;
-
-	/* Paint text box */
-	rc = ui_paint_text_box(resource, &rect, ui_box_single, color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_color_delete(color);
-	ui_resource_destroy(resource);
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Paint text horizontal brace */
-PCUT_TEST(text_hbrace)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	ui_resource_t *resource = NULL;
-	gfx_color_t *color = NULL;
-	test_gc_t tgc;
-	gfx_rect_t rect;
-
-	memset(&tgc, 0, sizeof(tgc));
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_resource_create(gc, false, &resource);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(resource);
-
-	rc = gfx_color_new_rgb_i16(1, 2, 3, &color);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rect.p0.x = 10;
-	rect.p0.y = 20;
-	rect.p1.x = 30;
-	rect.p1.y = 40;
-
-	/* Paint text horizontal brace */
-	rc = ui_paint_text_hbrace(resource, &rect, ui_box_single,
-	    color);
-
-	gfx_color_delete(color);
-	ui_resource_destroy(resource);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
Index: pace/lib/ui/test/promptdialog.c
===================================================================
--- uspace/lib/ui/test/promptdialog.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ 	(revision )
@@ -1,185 +1,0 @@
-/*
- * Copyright (c) 2021 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <pcut/pcut.h>
-#include <stdbool.h>
-#include <ui/pbutton.h>
-#include <ui/ui.h>
-#include <ui/promptdialog.h>
-#include "../private/promptdialog.h"
-#include "../private/window.h"
-
-PCUT_INIT;
-
-PCUT_TEST_SUITE(prompt_dialog);
-
-static void test_dialog_bok(ui_prompt_dialog_t *, void *, const char *);
-static void test_dialog_bcancel(ui_prompt_dialog_t *, void *);
-static void test_dialog_close(ui_prompt_dialog_t *, void *);
-
-static ui_prompt_dialog_cb_t test_prompt_dialog_cb = {
-	.bok = test_dialog_bok,
-	.bcancel = test_dialog_bcancel,
-	.close = test_dialog_close
-};
-
-static ui_prompt_dialog_cb_t dummy_prompt_dialog_cb = {
-};
-
-typedef struct {
-	bool bok;
-	const char *fname;
-	bool bcancel;
-	bool close;
-} test_cb_resp_t;
-
-/** Create and destroy prompt dialog */
-PCUT_TEST(create_destroy)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_prompt_dialog_params_t params;
-	ui_prompt_dialog_t *dialog = NULL;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_prompt_dialog_params_init(&params);
-	params.caption = "Open";
-
-	rc = ui_prompt_dialog_create(ui, &params, &dialog);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(dialog);
-
-	ui_prompt_dialog_destroy(dialog);
-	ui_destroy(ui);
-}
-
-/** ui_prompt_dialog_destroy() can take NULL argument (no-op) */
-PCUT_TEST(destroy_null)
-{
-	ui_prompt_dialog_destroy(NULL);
-}
-
-/** Button click invokes callback set via ui_prompt_dialog_set_cb() */
-PCUT_TEST(button_cb)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_prompt_dialog_params_t params;
-	ui_prompt_dialog_t *dialog = NULL;
-	test_cb_resp_t resp;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_prompt_dialog_params_init(&params);
-	params.caption = "Open";
-
-	rc = ui_prompt_dialog_create(ui, &params, &dialog);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(dialog);
-
-	/* OK button callback with no callbacks set */
-	ui_pbutton_clicked(dialog->bok);
-
-	/* OK button callback with callback not implemented */
-	ui_prompt_dialog_set_cb(dialog, &dummy_prompt_dialog_cb, NULL);
-	ui_pbutton_clicked(dialog->bok);
-
-	/* OK button callback with real callback set */
-	resp.bok = false;
-	ui_prompt_dialog_set_cb(dialog, &test_prompt_dialog_cb, &resp);
-	ui_pbutton_clicked(dialog->bok);
-	PCUT_ASSERT_TRUE(resp.bok);
-
-	ui_prompt_dialog_destroy(dialog);
-	ui_destroy(ui);
-}
-
-/** Sending window close request invokes callback set via
- * ui_prompt_dialog_set_cb()
- */
-PCUT_TEST(close_cb)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_prompt_dialog_params_t params;
-	ui_prompt_dialog_t *dialog = NULL;
-	test_cb_resp_t resp;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_prompt_dialog_params_init(&params);
-	params.caption = "Open";
-
-	rc = ui_prompt_dialog_create(ui, &params, &dialog);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(dialog);
-
-	/* Button callback with no callbacks set */
-	ui_window_send_close(dialog->window);
-
-	/* Button callback with unfocus callback not implemented */
-	ui_prompt_dialog_set_cb(dialog, &dummy_prompt_dialog_cb, NULL);
-	ui_window_send_close(dialog->window);
-
-	/* Button callback with real callback set */
-	resp.close = false;
-	ui_prompt_dialog_set_cb(dialog, &test_prompt_dialog_cb, &resp);
-	ui_window_send_close(dialog->window);
-	PCUT_ASSERT_TRUE(resp.close);
-
-	ui_prompt_dialog_destroy(dialog);
-	ui_destroy(ui);
-}
-
-static void test_dialog_bok(ui_prompt_dialog_t *dialog, void *arg,
-    const char *fname)
-{
-	test_cb_resp_t *resp = (test_cb_resp_t *) arg;
-
-	resp->bok = true;
-}
-
-static void test_dialog_bcancel(ui_prompt_dialog_t *dialog, void *arg)
-{
-	test_cb_resp_t *resp = (test_cb_resp_t *) arg;
-
-	resp->bcancel = true;
-}
-
-static void test_dialog_close(ui_prompt_dialog_t *dialog, void *arg)
-{
-	test_cb_resp_t *resp = (test_cb_resp_t *) arg;
-
-	resp->close = true;
-}
-
-PCUT_EXPORT(prompt_dialog);
Index: uspace/lib/ui/test/rbutton.c
===================================================================
--- uspace/lib/ui/test/rbutton.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/rbutton.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -166,6 +166,6 @@
 }
 
-/** Paint radio button in graphics mode */
-PCUT_TEST(paint_gfx)
+/** Paint radio button */
+PCUT_TEST(paint)
 {
 	errno_t rc;
@@ -190,40 +190,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = ui_rbutton_paint_gfx(rbutton);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_rbutton_destroy(rbutton);
-	ui_rbutton_group_destroy(group);
-	ui_resource_destroy(resource);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Paint radio button in text mode */
-PCUT_TEST(paint_text)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-	ui_rbutton_group_t *group = NULL;
-	ui_resource_t *resource = NULL;
-	ui_rbutton_t *rbutton;
-
-	memset(&tgc, 0, sizeof(tgc));
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_resource_create(gc, false, &resource);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(resource);
-
-	rc = ui_rbutton_group_create(resource, &group);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_rbutton_create(group, "Hello", NULL, &rbutton);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_rbutton_paint_text(rbutton);
+	rc = ui_rbutton_paint(rbutton);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
Index: uspace/lib/ui/test/slider.c
===================================================================
--- uspace/lib/ui/test/slider.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/slider.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -152,6 +152,6 @@
 }
 
-/** Paint slider in graphics mode */
-PCUT_TEST(paint_gfx)
+/** Paint slider */
+PCUT_TEST(paint)
 {
 	errno_t rc;
@@ -172,35 +172,5 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	rc = ui_slider_paint_gfx(slider);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_slider_destroy(slider);
-	ui_resource_destroy(resource);
-
-	rc = gfx_context_delete(gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-}
-
-/** Paint slider in text mode */
-PCUT_TEST(paint_text)
-{
-	errno_t rc;
-	gfx_context_t *gc = NULL;
-	test_gc_t tgc;
-	ui_resource_t *resource = NULL;
-	ui_slider_t *slider;
-
-	memset(&tgc, 0, sizeof(tgc));
-	rc = gfx_context_new(&ops, &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_resource_create(gc, false, &resource);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(resource);
-
-	rc = ui_slider_create(resource, "Hello", &slider);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	rc = ui_slider_paint_text(slider);
+	rc = ui_slider_paint(slider);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
Index: uspace/lib/ui/test/window.c
===================================================================
--- uspace/lib/ui/test/window.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/lib/ui/test/window.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -258,30 +258,4 @@
 }
 
-/** ui_window_get_ui() returns containing UI */
-PCUT_TEST(get_ui)
-{
-	errno_t rc;
-	ui_t *ui = NULL;
-	ui_t *rui;
-	ui_wnd_params_t params;
-	ui_window_t *window = NULL;
-
-	rc = ui_create_disp(NULL, &ui);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_wnd_params_init(&params);
-	params.caption = "Hello";
-
-	rc = ui_window_create(ui, &params, &window);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(window);
-
-	rui = ui_window_get_ui(window);
-	PCUT_ASSERT_EQUALS(ui, rui);
-
-	ui_window_destroy(window);
-	ui_destroy(ui);
-}
-
 /** ui_window_get_res/gc/rect() return valid objects */
 PCUT_TEST(get_res_gc_rect)
Index: uspace/meson.build
===================================================================
--- uspace/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -201,5 +201,5 @@
 		cpp_args: arch_uspace_c_args + tst.get('c_args'),
 		link_args: arch_uspace_c_args + arch_uspace_link_args + _ldargs,
-		implicit_include_directories: true,
+		implicit_include_directories: false,
 		build_by_default: true,
 	)
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/console/console.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -63,5 +63,5 @@
 typedef struct {
 	atomic_flag refcnt;      /**< Connection reference count */
-	prodcons_t input_pc;  /**< Incoming console events */
+	prodcons_t input_pc;  /**< Incoming keyboard events */
 
 	/**
@@ -99,14 +99,4 @@
 static sysarg_t cols;
 static sysarg_t rows;
-
-/** Mouse pointer X coordinate */
-static int pointer_x;
-/** Mouse pointer Y coordinate */
-static int pointer_y;
-/** Character under mouse cursor */
-static charfield_t pointer_bg;
-
-static int mouse_scale_x = 4;
-static int mouse_scale_y = 8;
 
 /** Array of data for virtual consoles */
@@ -176,7 +166,4 @@
 };
 
-static void pointer_draw(void);
-static void pointer_undraw(void);
-
 static console_t *srv_to_console(con_srv_t *srv)
 {
@@ -244,5 +231,4 @@
 
 	fibril_mutex_lock(&switch_mtx);
-	pointer_undraw();
 
 	if (cons == active_console) {
@@ -253,85 +239,7 @@
 	active_console = cons;
 
-	pointer_draw();
 	fibril_mutex_unlock(&switch_mtx);
 
 	cons_damage(cons);
-}
-
-/** Draw mouse pointer. */
-static void pointer_draw(void)
-{
-	charfield_t *ch;
-	int col, row;
-
-	/* Downscale coordinates to text resolution */
-	col = pointer_x / mouse_scale_x;
-	row = pointer_y / mouse_scale_y;
-
-	/* Make sure they are in range */
-	if (col < 0 || row < 0 || col >= (int)cols || row >= (int)rows)
-		return;
-
-	ch = chargrid_charfield_at(active_console->frontbuf, col, row);
-
-	/*
-	 * Store background attributes for undrawing the pointer.
-	 * This is necessary as styles cannot be inverted with
-	 * round trip (unlike RGB or INDEX)
-	 */
-	pointer_bg = *ch;
-
-	/* In general the color should be a one's complement of the background */
-	if (ch->attrs.type == CHAR_ATTR_INDEX) {
-		ch->attrs.val.index.bgcolor ^= 0xf;
-		ch->attrs.val.index.fgcolor ^= 0xf;
-	} else if (ch->attrs.type == CHAR_ATTR_RGB) {
-		ch->attrs.val.rgb.fgcolor ^= 0xffffff;
-		ch->attrs.val.rgb.bgcolor ^= 0xffffff;
-	} else if (ch->attrs.type == CHAR_ATTR_STYLE) {
-		/* Don't have a proper inverse for each style */
-		if (ch->attrs.val.style == STYLE_INVERTED)
-			ch->attrs.val.style = STYLE_NORMAL;
-		else
-			ch->attrs.val.style = STYLE_INVERTED;
-	}
-
-	/* Make sure the cell gets updated */
-	ch->flags |= CHAR_FLAG_DIRTY;
-}
-
-/** Undraw mouse pointer. */
-static void pointer_undraw(void)
-{
-	charfield_t *ch;
-	int col, row;
-
-	col = pointer_x / mouse_scale_x;
-	row = pointer_y / mouse_scale_y;
-	if (col < 0 || row < 0 || col >= (int)cols || row >= (int)rows)
-		return;
-
-	ch = chargrid_charfield_at(active_console->frontbuf, col, row);
-	*ch = pointer_bg;
-	ch->flags |= CHAR_FLAG_DIRTY;
-}
-
-/** Queue console event.
- *
- * @param cons Console
- * @param ev Console event
- */
-static void console_queue_cons_event(console_t *cons, cons_event_t *ev)
-{
-	/* Got key press/release event */
-	cons_event_t *event =
-	    (cons_event_t *) malloc(sizeof(cons_event_t));
-	if (event == NULL)
-		return;
-
-	*event = *ev;
-	link_initialize(&event->link);
-
-	prodcons_produce(&cons->input_pc, &event->link);
 }
 
@@ -356,6 +264,4 @@
     keymod_t mods, char32_t c)
 {
-	cons_event_t event;
-
 	if ((key >= KC_F1) && (key <= KC_F1 + CONSOLE_COUNT) &&
 	    ((mods & KM_CTRL) == 0)) {
@@ -363,57 +269,25 @@
 	} else {
 		/* Got key press/release event */
-		event.type = CEV_KEY;
-
-		event.ev.key.type = type;
-		event.ev.key.key = key;
-		event.ev.key.mods = mods;
-		event.ev.key.c = c;
-
-		console_queue_cons_event(active_console, &event);
-	}
-
-	return EOK;
-}
-
-/** Update pointer position.
- *
- * @param new_x New X coordinate (in pixels)
- * @param new_y New Y coordinate (in pixels)
- */
-static void pointer_update(int new_x, int new_y)
-{
-	bool upd_pointer;
-
-	/* Make sure coordinates are in range */
-
-	if (new_x < 0)
-		new_x = 0;
-	if (new_x >= (int)cols * mouse_scale_x)
-		new_x = cols * mouse_scale_x - 1;
-	if (new_y < 0)
-		new_y = 0;
-	if (new_y >= (int)rows * mouse_scale_y)
-		new_y = rows * mouse_scale_y - 1;
-
-	/* Determine if pointer moved to a different character cell */
-	upd_pointer = (new_x / mouse_scale_x != pointer_x / mouse_scale_x) ||
-	    (new_y / mouse_scale_y != pointer_y / mouse_scale_y);
-
-	if (upd_pointer)
-		pointer_undraw();
-
-	/* Store new pointer position */
-	pointer_x = new_x;
-	pointer_y = new_y;
-
-	if (upd_pointer) {
-		pointer_draw();
-		cons_update(active_console);
-	}
+		kbd_event_t *event =
+		    (kbd_event_t *) malloc(sizeof(kbd_event_t));
+		if (event == NULL) {
+			return ENOMEM;
+		}
+
+		link_initialize(&event->link);
+		event->type = type;
+		event->key = key;
+		event->mods = mods;
+		event->c = c;
+
+		prodcons_produce(&active_console->input_pc,
+		    &event->link);
+	}
+
+	return EOK;
 }
 
 static errno_t input_ev_move(input_t *input, int dx, int dy)
 {
-	pointer_update(pointer_x + dx, pointer_y + dy);
 	return EOK;
 }
@@ -422,5 +296,4 @@
     unsigned max_x, unsigned max_y)
 {
-	pointer_update(mouse_scale_x * cols * x / max_x, mouse_scale_y * rows * y / max_y);
 	return EOK;
 }
@@ -428,13 +301,4 @@
 static errno_t input_ev_button(input_t *input, int bnum, int bpress)
 {
-	cons_event_t event;
-
-	event.type = CEV_POS;
-	event.ev.pos.type = bpress ? POS_PRESS : POS_RELEASE;
-	event.ev.pos.btn_num = bnum;
-	event.ev.pos.hpos = pointer_x / mouse_scale_x;
-	event.ev.pos.vpos = pointer_y / mouse_scale_y;
-
-	console_queue_cons_event(active_console, &event);
 	return EOK;
 }
@@ -446,5 +310,4 @@
 
 	fibril_mutex_lock(&cons->mtx);
-	pointer_undraw();
 
 	switch (ch) {
@@ -464,5 +327,4 @@
 	}
 
-	pointer_draw();
 	fibril_mutex_unlock(&cons->mtx);
 
@@ -474,7 +336,5 @@
 {
 	fibril_mutex_lock(&cons->mtx);
-	pointer_undraw();
 	chargrid_set_cursor_visibility(cons->frontbuf, visible);
-	pointer_draw();
 	fibril_mutex_unlock(&cons->mtx);
 
@@ -519,11 +379,9 @@
 		if (pos < size) {
 			link_t *link = prodcons_consume(&cons->input_pc);
-			cons_event_t *event = list_get_instance(link,
-			    cons_event_t, link);
+			kbd_event_t *event = list_get_instance(link, kbd_event_t, link);
 
 			/* Accept key presses of printable chars only. */
-			if (event->type == CEV_KEY && event->ev.key.type == KEY_PRESS &&
-			    (event->ev.key.c != 0)) {
-				char32_t tmp[2] = { event->ev.key.c, 0 };
+			if ((event->type == KEY_PRESS) && (event->c != 0)) {
+				char32_t tmp[2] = { event->c, 0 };
 				wstr_to_str(cons->char_remains, UTF8_CHAR_BUFFER_SIZE, tmp);
 				cons->char_remains_len = str_size(cons->char_remains);
@@ -562,7 +420,5 @@
 
 	fibril_mutex_lock(&cons->mtx);
-	pointer_undraw();
 	chargrid_clear(cons->frontbuf);
-	pointer_draw();
 	fibril_mutex_unlock(&cons->mtx);
 
@@ -575,7 +431,5 @@
 
 	fibril_mutex_lock(&cons->mtx);
-	pointer_undraw();
 	chargrid_set_cursor(cons->frontbuf, col, row);
-	pointer_draw();
 	fibril_mutex_unlock(&cons->mtx);
 
@@ -657,8 +511,10 @@
 	console_t *cons = srv_to_console(srv);
 	link_t *link = prodcons_consume(&cons->input_pc);
-	cons_event_t *cevent = list_get_instance(link, cons_event_t, link);
-
-	*event = *cevent;
-	free(cevent);
+	kbd_event_t *kevent = list_get_instance(link, kbd_event_t, link);
+
+	event->type = CEV_KEY;
+	event->ev.key = *kevent;
+
+	free(kevent);
 	return EOK;
 }
@@ -765,6 +621,4 @@
 	/* Update front buffer from user buffer */
 
-	pointer_undraw();
-
 	for (row = r0; row < r1; row++) {
 		for (col = c0; col < c1; col++) {
@@ -774,5 +628,4 @@
 	}
 
-	pointer_draw();
 	fibril_mutex_unlock(&cons->mtx);
 
Index: uspace/srv/hid/display/display.c
===================================================================
--- uspace/srv/hid/display/display.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/display/display.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2019 Jiri Svoboda
  * All rights reserved.
  *
@@ -53,9 +53,4 @@
 static void ds_display_update_cb(void *);
 
-static mem_gc_cb_t ds_display_mem_gc_cb = {
-	.invalidate = ds_display_invalidate_cb,
-	.update = ds_display_update_cb
-};
-
 /** Create display.
  *
@@ -464,6 +459,7 @@
 		goto error;
 
-	rc = mem_gc_create(&disp->rect, &alloc, &ds_display_mem_gc_cb,
-	    (void *) disp, &disp->bbgc);
+	rc = mem_gc_create(&disp->rect, &alloc,
+	    ds_display_invalidate_cb, ds_display_update_cb, (void *) disp,
+	    &disp->bbgc);
 	if (rc != EOK)
 		goto error;
Index: uspace/srv/hid/display/window.c
===================================================================
--- uspace/srv/hid/display/window.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/display/window.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -53,9 +53,4 @@
 static void ds_window_get_preview_rect(ds_window_t *, gfx_rect_t *);
 
-static mem_gc_cb_t ds_window_mem_gc_cb = {
-	.invalidate = ds_window_invalidate_cb,
-	.update = ds_window_update_cb
-};
-
 /** Create window.
  *
@@ -113,6 +108,6 @@
 	}
 
-	rc = mem_gc_create(&params->rect, &alloc, &ds_window_mem_gc_cb,
-	    (void *)wnd, &wnd->mgc);
+	rc = mem_gc_create(&params->rect, &alloc, ds_window_invalidate_cb,
+	    ds_window_update_cb, (void *)wnd, &wnd->mgc);
 	if (rc != EOK)
 		goto error;
Index: uspace/srv/hid/input/input.c
===================================================================
--- uspace/srv/hid/input/input.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/input/input.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -641,7 +641,4 @@
 	kbd_add_dev(&chardev_port, &stty_ctl);
 #endif
-#if defined(UARCH_arm64) && defined(MACHINE_hikey960)
-	kbd_add_dev(&chardev_port, &stty_ctl);
-#endif
 	/* Silence warning on abs32le about kbd_add_dev() being unused */
 	(void) kbd_add_dev;
Index: uspace/srv/hid/output/meson.build
===================================================================
--- uspace/srv/hid/output/meson.build	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/output/meson.build	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -28,5 +28,5 @@
 #
 
-deps = [ 'codepage', 'drv', 'fbfont', 'pixconv', 'ddev' ]
+deps = [ 'drv', 'fbfont', 'pixconv', 'ddev' ]
 src = files(
 	'ctl/serial.c',
Index: uspace/srv/hid/output/port/chardev.c
===================================================================
--- uspace/srv/hid/output/port/chardev.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/output/port/chardev.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -78,25 +78,11 @@
 }
 
-static void chardev_putchar(char ch)
+static void chardev_putuchar(char32_t ch)
 {
 	if (chardev_bused == chardev_buf_size)
 		chardev_flush();
+	if (!ascii_check(ch))
+		ch = '?';
 	chardev_buf[chardev_bused++] = (uint8_t) ch;
-}
-
-static void chardev_putuchar(char32_t ch)
-{
-	char buf[STR_BOUNDS(1)];
-	size_t off;
-	size_t i;
-	errno_t rc;
-
-	off = 0;
-	rc = chr_encode(ch, buf, &off, sizeof(buf));
-	if (rc != EOK)
-		return;
-
-	for (i = 0; i < off; i++)
-		chardev_putchar(buf[i]);
 }
 
@@ -232,6 +218,4 @@
 #elif defined(UARCH_arm64) && defined(MACHINE_virt)
 		/* OK */
-#elif defined(UARCH_arm64) && defined(MACHINE_hikey960)
-		/* OK */
 #else
 		return EOK;
Index: uspace/srv/hid/output/port/ega.c
===================================================================
--- uspace/srv/hid/output/port/ega.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/output/port/ega.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2011 Martin Decky
  * All rights reserved.
@@ -32,5 +31,4 @@
  */
 
-#include <codepage/cp437.h>
 #include <errno.h>
 #include <sysinfo.h>
@@ -108,8 +106,8 @@
 {
 	uint8_t glyph;
-	errno_t rc;
-
-	rc = cp437_encode(field->ch, &glyph);
-	if (rc != EOK)
+
+	if (ascii_check(field->ch))
+		glyph = field->ch;
+	else
 		glyph = '?';
 
Index: uspace/srv/hid/output/proto/vt100.c
===================================================================
--- uspace/srv/hid/output/proto/vt100.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/hid/output/proto/vt100.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2011 Martin Decky
  * All rights reserved.
@@ -66,5 +65,5 @@
 static sgr_color_index_t color_map[] = {
 	[COLOR_BLACK]   = CI_BLACK,
-	[COLOR_BLUE]    = CI_BLUE,
+	[COLOR_BLUE]    = CI_RED,
 	[COLOR_GREEN]   = CI_GREEN,
 	[COLOR_CYAN]    = CI_CYAN,
Index: uspace/srv/net/dhcp/dhcp.c
===================================================================
--- uspace/srv/net/dhcp/dhcp.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/dhcp/dhcp.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -42,5 +42,4 @@
 #include <fibril_synch.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include <inet/dnsr.h>
 #include <inet/inetcfg.h>
@@ -158,9 +157,9 @@
 	hdr->op = op_bootrequest;
 	hdr->htype = 1; /* AHRD_ETHERNET */
-	hdr->hlen = ETH_ADDR_SIZE;
+	hdr->hlen = sizeof(addr48_t);
 	hdr->xid = host2uint32_t_be(42);
 	hdr->flags = flag_broadcast;
 
-	eth_addr_encode(&dlink->link_info.mac_addr, hdr->chaddr);
+	addr48(dlink->link_info.mac_addr, hdr->chaddr);
 	hdr->opt_magic = host2uint32_t_be(dhcp_opt_magic);
 
@@ -186,5 +185,5 @@
 	hdr->flags = flag_broadcast;
 	hdr->ciaddr = host2uint32_t_be(offer->oaddr.addr);
-	eth_addr_encode(&dlink->link_info.mac_addr, hdr->chaddr);
+	addr48(dlink->link_info.mac_addr, hdr->chaddr);
 	hdr->opt_magic = host2uint32_t_be(dhcp_opt_magic);
 
Index: uspace/srv/net/ethip/arp.c
===================================================================
--- uspace/srv/net/ethip/arp.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/arp.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -36,8 +36,7 @@
 
 #include <errno.h>
+#include <io/log.h>
 #include <inet/iplink_srv.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
-#include <io/log.h>
 #include <stdlib.h>
 #include "arp.h"
@@ -80,5 +79,5 @@
 
 	(void) atrans_add(packet.sender_proto_addr,
-	    &packet.sender_hw_addr);
+	    packet.sender_hw_addr);
 
 	if (packet.opcode == aop_request) {
@@ -86,7 +85,7 @@
 
 		reply.opcode = aop_reply;
-		reply.sender_hw_addr = nic->mac_addr;
+		addr48(nic->mac_addr, reply.sender_hw_addr);
 		reply.sender_proto_addr = laddr_v4;
-		reply.target_hw_addr = packet.sender_hw_addr;
+		addr48(packet.sender_hw_addr, reply.target_hw_addr);
 		reply.target_proto_addr = packet.sender_proto_addr;
 
@@ -96,9 +95,9 @@
 
 errno_t arp_translate(ethip_nic_t *nic, addr32_t src_addr, addr32_t ip_addr,
-    eth_addr_t *mac_addr)
+    addr48_t mac_addr)
 {
 	/* Broadcast address */
 	if (ip_addr == addr32_broadcast_all_hosts) {
-		*mac_addr = eth_addr_broadcast;
+		addr48(addr48_broadcast, mac_addr);
 		return EOK;
 	}
@@ -111,7 +110,7 @@
 
 	packet.opcode = aop_request;
-	packet.sender_hw_addr = nic->mac_addr;
+	addr48(nic->mac_addr, packet.sender_hw_addr);
 	packet.sender_proto_addr = src_addr;
-	packet.target_hw_addr = eth_addr_broadcast;
+	addr48(addr48_broadcast, packet.target_hw_addr);
 	packet.target_proto_addr = ip_addr;
 
@@ -139,6 +138,6 @@
 		return rc;
 
-	frame.dest = packet->target_hw_addr;
-	frame.src = packet->sender_hw_addr;
+	addr48(packet->target_hw_addr, frame.dest);
+	addr48(packet->sender_hw_addr, frame.src);
 	frame.etype_len = ETYPE_ARP;
 	frame.data = pdata;
Index: uspace/srv/net/ethip/arp.h
===================================================================
--- uspace/srv/net/ethip/arp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/arp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,11 +38,10 @@
 #define ARP_H_
 
+#include <inet/iplink_srv.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
-#include <inet/iplink_srv.h>
 #include "ethip.h"
 
 extern void arp_received(ethip_nic_t *, eth_frame_t *);
-extern errno_t arp_translate(ethip_nic_t *, addr32_t, addr32_t, eth_addr_t *);
+extern errno_t arp_translate(ethip_nic_t *, addr32_t, addr32_t, addr48_t);
 
 #endif
Index: uspace/srv/net/ethip/atrans.c
===================================================================
--- uspace/srv/net/ethip/atrans.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/atrans.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,5 +38,4 @@
 #include <errno.h>
 #include <fibril_synch.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink_srv.h>
 #include <stdlib.h>
@@ -60,5 +59,5 @@
 }
 
-errno_t atrans_add(addr32_t ip_addr, eth_addr_t *mac_addr)
+errno_t atrans_add(addr32_t ip_addr, addr48_t mac_addr)
 {
 	ethip_atrans_t *atrans;
@@ -70,5 +69,5 @@
 
 	atrans->ip_addr = ip_addr;
-	atrans->mac_addr = *mac_addr;
+	addr48(mac_addr, atrans->mac_addr);
 
 	fibril_mutex_lock(&atrans_list_lock);
@@ -104,5 +103,5 @@
 }
 
-static errno_t atrans_lookup_locked(addr32_t ip_addr, eth_addr_t *mac_addr)
+static errno_t atrans_lookup_locked(addr32_t ip_addr, addr48_t mac_addr)
 {
 	ethip_atrans_t *atrans = atrans_find(ip_addr);
@@ -110,9 +109,9 @@
 		return ENOENT;
 
-	*mac_addr = atrans->mac_addr;
+	addr48(atrans->mac_addr, mac_addr);
 	return EOK;
 }
 
-errno_t atrans_lookup(addr32_t ip_addr, eth_addr_t *mac_addr)
+errno_t atrans_lookup(addr32_t ip_addr, addr48_t mac_addr)
 {
 	errno_t rc;
@@ -136,5 +135,5 @@
 
 errno_t atrans_lookup_timeout(addr32_t ip_addr, usec_t timeout,
-    eth_addr_t *mac_addr)
+    addr48_t mac_addr)
 {
 	fibril_timer_t *t;
Index: uspace/srv/net/ethip/atrans.h
===================================================================
--- uspace/srv/net/ethip/atrans.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/atrans.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,13 +38,12 @@
 #define ATRANS_H_
 
+#include <inet/iplink_srv.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
-#include <inet/iplink_srv.h>
 #include "ethip.h"
 
-extern errno_t atrans_add(addr32_t, eth_addr_t *);
+extern errno_t atrans_add(addr32_t, addr48_t);
 extern errno_t atrans_remove(addr32_t);
-extern errno_t atrans_lookup(addr32_t, eth_addr_t *);
-extern errno_t atrans_lookup_timeout(addr32_t, usec_t, eth_addr_t *);
+extern errno_t atrans_lookup(addr32_t, addr48_t);
+extern errno_t atrans_lookup_timeout(addr32_t, usec_t, addr48_t);
 
 #endif
Index: uspace/srv/net/ethip/ethip.c
===================================================================
--- uspace/srv/net/ethip/ethip.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/ethip.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -39,5 +39,4 @@
 #include <async.h>
 #include <errno.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink_srv.h>
 #include <io/log.h>
@@ -59,6 +58,6 @@
 static errno_t ethip_send6(iplink_srv_t *srv, iplink_sdu6_t *sdu);
 static errno_t ethip_get_mtu(iplink_srv_t *srv, size_t *mtu);
-static errno_t ethip_get_mac48(iplink_srv_t *srv, eth_addr_t *mac);
-static errno_t ethip_set_mac48(iplink_srv_t *srv, eth_addr_t *mac);
+static errno_t ethip_get_mac48(iplink_srv_t *srv, addr48_t *mac);
+static errno_t ethip_set_mac48(iplink_srv_t *srv, addr48_t *mac);
 static errno_t ethip_addr_add(iplink_srv_t *srv, inet_addr_t *addr);
 static errno_t ethip_addr_remove(iplink_srv_t *srv, inet_addr_t *addr);
@@ -178,5 +177,5 @@
 	eth_frame_t frame;
 
-	errno_t rc = arp_translate(nic, sdu->src, sdu->dest, &frame.dest);
+	errno_t rc = arp_translate(nic, sdu->src, sdu->dest, frame.dest);
 	if (rc != EOK) {
 		log_msg(LOG_DEFAULT, LVL_WARN, "Failed to look up IPv4 address 0x%"
@@ -185,5 +184,5 @@
 	}
 
-	frame.src = nic->mac_addr;
+	addr48(nic->mac_addr, frame.src);
 	frame.etype_len = ETYPE_IP;
 	frame.data = sdu->data;
@@ -209,6 +208,6 @@
 	eth_frame_t frame;
 
-	frame.dest = sdu->dest;
-	frame.src = nic->mac_addr;
+	addr48(sdu->dest, frame.dest);
+	addr48(nic->mac_addr, frame.src);
 	frame.etype_len = ETYPE_IPV6;
 	frame.data = sdu->data;
@@ -277,20 +276,20 @@
 }
 
-static errno_t ethip_get_mac48(iplink_srv_t *srv, eth_addr_t *mac)
+static errno_t ethip_get_mac48(iplink_srv_t *srv, addr48_t *mac)
 {
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_get_mac48()");
 
 	ethip_nic_t *nic = (ethip_nic_t *) srv->arg;
-	*mac = nic->mac_addr;
-
-	return EOK;
-}
-
-static errno_t ethip_set_mac48(iplink_srv_t *srv, eth_addr_t *mac)
+	addr48(nic->mac_addr, *mac);
+
+	return EOK;
+}
+
+static errno_t ethip_set_mac48(iplink_srv_t *srv, addr48_t *mac)
 {
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_set_mac48()");
 
 	ethip_nic_t *nic = (ethip_nic_t *) srv->arg;
-	nic->mac_addr = *mac;
+	addr48(*mac, nic->mac_addr);
 
 	return EOK;
Index: uspace/srv/net/ethip/ethip.h
===================================================================
--- uspace/srv/net/ethip/ethip.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/ethip.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -40,7 +40,6 @@
 #include <adt/list.h>
 #include <async.h>
+#include <inet/iplink_srv.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
-#include <inet/iplink_srv.h>
 #include <loc.h>
 #include <stddef.h>
@@ -62,5 +61,5 @@
 
 	/** MAC address */
-	eth_addr_t mac_addr;
+	addr48_t mac_addr;
 
 	/**
@@ -74,7 +73,7 @@
 typedef struct {
 	/** Destination Address */
-	eth_addr_t dest;
+	addr48_t dest;
 	/** Source Address */
-	eth_addr_t src;
+	addr48_t src;
 	/** Ethertype or Length */
 	uint16_t etype_len;
@@ -101,9 +100,9 @@
 	arp_opcode_t opcode;
 	/** Sender hardware address */
-	eth_addr_t sender_hw_addr;
+	addr48_t sender_hw_addr;
 	/** Sender protocol address */
 	addr32_t sender_proto_addr;
 	/** Target hardware address */
-	eth_addr_t target_hw_addr;
+	addr48_t target_hw_addr;
 	/** Target protocol address */
 	addr32_t target_proto_addr;
@@ -114,5 +113,5 @@
 	link_t atrans_list;
 	addr32_t ip_addr;
-	eth_addr_t mac_addr;
+	addr48_t mac_addr;
 } ethip_atrans_t;
 
Index: uspace/srv/net/ethip/ethip_nic.c
===================================================================
--- uspace/srv/net/ethip/ethip_nic.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/ethip_nic.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -37,15 +37,14 @@
 #include <adt/list.h>
 #include <async.h>
+#include <stdbool.h>
 #include <errno.h>
+#include <str_error.h>
 #include <fibril_synch.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink_srv.h>
 #include <io/log.h>
 #include <loc.h>
+#include <nic_iface.h>
+#include <stdlib.h>
 #include <mem.h>
-#include <nic_iface.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <str_error.h>
 #include "ethip.h"
 #include "ethip_nic.h"
@@ -194,5 +193,5 @@
 	}
 
-	eth_addr_decode(nic_address.address, &nic->mac_addr);
+	addr48(nic_address.address, nic->mac_addr);
 
 	rc = nic_set_state(nic->sess, NIC_STATE_ACTIVE);
@@ -400,6 +399,6 @@
 		assert(i < count);
 
-		eth_addr_t mac;
-		eth_addr_solicited_node(v6, &mac);
+		addr48_t mac;
+		addr48_solicited_node(v6, mac);
 
 		/* Avoid duplicate addresses in the list */
@@ -408,7 +407,5 @@
 
 		for (size_t j = 0; j < i; j++) {
-			eth_addr_t mac_entry;
-			eth_addr_decode(mac_list[j].address, &mac_entry);
-			if (eth_addr_compare(&mac_entry, &mac)) {
+			if (addr48_compare(mac_list[j].address, mac)) {
 				found = true;
 				break;
@@ -417,9 +414,8 @@
 
 		if (!found) {
-			eth_addr_encode(&mac, mac_list[i].address);
+			addr48(mac, mac_list[i].address);
 			i++;
-		} else {
+		} else
 			count--;
-		}
 	}
 
Index: uspace/srv/net/ethip/pdu.c
===================================================================
--- uspace/srv/net/ethip/pdu.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/pdu.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -60,6 +60,6 @@
 
 	hdr = (eth_header_t *)data;
-	eth_addr_encode(&frame->src, hdr->src);
-	eth_addr_encode(&frame->dest, hdr->dest);
+	addr48(frame->src, hdr->src);
+	addr48(frame->dest, hdr->dest);
 	hdr->etype_len = host2uint16_t_be(frame->etype_len);
 
@@ -93,6 +93,6 @@
 		return ENOMEM;
 
-	eth_addr_decode(hdr->src, &frame->src);
-	eth_addr_decode(hdr->dest, &frame->dest);
+	addr48(hdr->src, frame->src);
+	addr48(hdr->dest, frame->dest);
 	frame->etype_len = uint16_t_be2host(hdr->etype_len);
 
@@ -140,8 +140,8 @@
 	pfmt->proto_addr_size = IPV4_ADDR_SIZE;
 	pfmt->opcode = host2uint16_t_be(fopcode);
-	eth_addr_encode(&packet->sender_hw_addr, pfmt->sender_hw_addr);
+	addr48(packet->sender_hw_addr, pfmt->sender_hw_addr);
 	pfmt->sender_proto_addr =
 	    host2uint32_t_be(packet->sender_proto_addr);
-	eth_addr_encode(&packet->target_hw_addr, pfmt->target_hw_addr);
+	addr48(packet->target_hw_addr, pfmt->target_hw_addr);
 	pfmt->target_proto_addr =
 	    host2uint32_t_be(packet->target_proto_addr);
@@ -203,8 +203,8 @@
 	}
 
-	eth_addr_decode(pfmt->sender_hw_addr, &packet->sender_hw_addr);
+	addr48(pfmt->sender_hw_addr, packet->sender_hw_addr);
 	packet->sender_proto_addr =
 	    uint32_t_be2host(pfmt->sender_proto_addr);
-	eth_addr_decode(pfmt->target_hw_addr, &packet->target_hw_addr);
+	addr48(pfmt->target_hw_addr, packet->target_hw_addr);
 	packet->target_proto_addr =
 	    uint32_t_be2host(pfmt->target_proto_addr);
Index: uspace/srv/net/ethip/pdu.h
===================================================================
--- uspace/srv/net/ethip/pdu.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/pdu.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
Index: uspace/srv/net/ethip/std.h
===================================================================
--- uspace/srv/net/ethip/std.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/ethip/std.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -39,4 +39,5 @@
 
 #include <stdint.h>
+#include <inet/addr.h>
 
 #define ETH_ADDR_SIZE       6
@@ -47,7 +48,7 @@
 typedef struct {
 	/** Destination Address */
-	uint8_t dest[ETH_ADDR_SIZE];
+	addr48_t dest;
 	/** Source Address */
-	uint8_t src[ETH_ADDR_SIZE];
+	addr48_t src;
 	/** Ethertype or Length */
 	uint16_t etype_len;
@@ -67,11 +68,11 @@
 	uint16_t opcode;
 	/** Sender hardware address */
-	uint8_t sender_hw_addr[ETH_ADDR_SIZE];
+	addr48_t sender_hw_addr;
 	/** Sender protocol address */
-	uint32_t sender_proto_addr;
+	addr32_t sender_proto_addr;
 	/** Target hardware address */
-	uint8_t target_hw_addr[ETH_ADDR_SIZE];
+	addr48_t target_hw_addr;
 	/** Target protocol address */
-	uint32_t target_proto_addr;
+	addr32_t target_proto_addr;
 } __attribute__((packed)) arp_eth_packet_fmt_t;
 
Index: uspace/srv/net/inetsrv/addrobj.c
===================================================================
--- uspace/srv/net/inetsrv/addrobj.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/addrobj.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,5 +38,4 @@
 #include <errno.h>
 #include <fibril_synch.h>
-#include <inet/eth_addr.h>
 #include <io/log.h>
 #include <ipc/loc.h>
@@ -230,5 +229,5 @@
 
 	errno_t rc;
-	eth_addr_t ldest_mac;
+	addr48_t ldest_mac;
 
 	switch (ldest_ver) {
@@ -240,9 +239,9 @@
 		 * Translate local destination IPv6 address.
 		 */
-		rc = ndp_translate(lsrc_v6, ldest_v6, &ldest_mac, addr->ilink);
+		rc = ndp_translate(lsrc_v6, ldest_v6, ldest_mac, addr->ilink);
 		if (rc != EOK)
 			return rc;
 
-		return inet_link_send_dgram6(addr->ilink, &ldest_mac, dgram,
+		return inet_link_send_dgram6(addr->ilink, ldest_mac, dgram,
 		    proto, ttl, df);
 	default:
Index: uspace/srv/net/inetsrv/inet_link.c
===================================================================
--- uspace/srv/net/inetsrv/inet_link.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/inet_link.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -35,14 +35,13 @@
  */
 
+#include <stdbool.h>
 #include <errno.h>
+#include <str_error.h>
 #include <fibril_synch.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink.h>
 #include <io/log.h>
 #include <loc.h>
-#include <stdbool.h>
 #include <stdlib.h>
 #include <str.h>
-#include <str_error.h>
 #include "addrobj.h"
 #include "inetsrv.h"
@@ -57,5 +56,5 @@
 
 static errno_t inet_iplink_recv(iplink_t *, iplink_recv_sdu_t *, ip_ver_t);
-static errno_t inet_iplink_change_addr(iplink_t *, eth_addr_t *);
+static errno_t inet_iplink_change_addr(iplink_t *, addr48_t);
 static inet_link_t *inet_link_get_by_id_locked(sysarg_t);
 
@@ -71,18 +70,15 @@
     { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xfe, 0, 0, 0 };
 
-static void inet_link_local_node_ip(eth_addr_t *mac_addr,
+static void inet_link_local_node_ip(addr48_t mac_addr,
     addr128_t ip_addr)
 {
-	uint8_t b[ETH_ADDR_SIZE];
-
 	memcpy(ip_addr, link_local_node_ip, 16);
-	eth_addr_encode(mac_addr, b);
-
-	ip_addr[8] = b[0] ^ 0x02;
-	ip_addr[9] = b[1];
-	ip_addr[10] = b[2];
-	ip_addr[13] = b[3];
-	ip_addr[14] = b[4];
-	ip_addr[15] = b[5];
+
+	ip_addr[8] = mac_addr[0] ^ 0x02;
+	ip_addr[9] = mac_addr[1];
+	ip_addr[10] = mac_addr[2];
+	ip_addr[13] = mac_addr[3];
+	ip_addr[14] = mac_addr[4];
+	ip_addr[15] = mac_addr[5];
 }
 
@@ -125,15 +121,13 @@
 }
 
-static errno_t inet_iplink_change_addr(iplink_t *iplink, eth_addr_t *mac)
-{
-	eth_addr_str_t saddr;
-
-	eth_addr_format(mac, &saddr);
+static errno_t inet_iplink_change_addr(iplink_t *iplink, addr48_t mac)
+{
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_iplink_change_addr(): "
-	    "new addr=%s", saddr.str);
+	    "new addr=%02x:%02x:%02x:%02x:%02x:%02x",
+	    mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
 
 	list_foreach(inet_links, link_list, inet_link_t, ilink) {
 		if (ilink->sess == iplink->sess)
-			ilink->mac = *mac;
+			memcpy(&ilink->mac, mac, sizeof(addr48_t));
 	}
 
@@ -267,5 +261,5 @@
 
 		addr128_t link_local;
-		inet_link_local_node_ip(&ilink->mac, link_local);
+		inet_link_local_node_ip(ilink->mac, link_local);
 
 		inet_naddr_set6(link_local, 64, &addr6->naddr);
@@ -393,5 +387,5 @@
  *
  */
-errno_t inet_link_send_dgram6(inet_link_t *ilink, eth_addr_t *ldest,
+errno_t inet_link_send_dgram6(inet_link_t *ilink, addr48_t ldest,
     inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, int df)
 {
@@ -407,5 +401,5 @@
 
 	iplink_sdu6_t sdu6;
-	sdu6.dest = *ldest;
+	addr48(ldest, sdu6.dest);
 
 	/*
Index: uspace/srv/net/inetsrv/inet_link.h
===================================================================
--- uspace/srv/net/inetsrv/inet_link.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/inet_link.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,5 +38,4 @@
 #define INET_LINK_H_
 
-#include <inet/eth_addr.h>
 #include <stddef.h>
 #include <stdint.h>
@@ -46,5 +45,5 @@
 extern errno_t inet_link_send_dgram(inet_link_t *, addr32_t,
     addr32_t, inet_dgram_t *, uint8_t, uint8_t, int);
-extern errno_t inet_link_send_dgram6(inet_link_t *, eth_addr_t *, inet_dgram_t *,
+extern errno_t inet_link_send_dgram6(inet_link_t *, addr48_t, inet_dgram_t *,
     uint8_t, uint8_t, int);
 extern inet_link_t *inet_link_get_by_id(sysarg_t);
Index: uspace/srv/net/inetsrv/inetcfg.c
===================================================================
--- uspace/srv/net/inetsrv/inetcfg.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/inetcfg.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -177,7 +177,7 @@
 	linfo->def_mtu = ilink->def_mtu;
 	if (ilink->mac_valid) {
-		linfo->mac_addr = ilink->mac;
+		addr48(ilink->mac, linfo->mac_addr);
 	} else {
-		memset(&linfo->mac_addr, 0, sizeof(linfo->mac_addr));
+		memset(linfo->mac_addr, 0, sizeof(linfo->mac_addr));
 	}
 
Index: uspace/srv/net/inetsrv/inetsrv.h
===================================================================
--- uspace/srv/net/inetsrv/inetsrv.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/inetsrv.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -41,5 +41,4 @@
 #include <stdbool.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink.h>
 #include <ipc/loc.h>
@@ -110,5 +109,5 @@
 	iplink_t *iplink;
 	size_t def_mtu;
-	eth_addr_t mac;
+	addr48_t mac;
 	bool mac_valid;
 } inet_link_t;
Index: uspace/srv/net/inetsrv/ndp.c
===================================================================
--- uspace/srv/net/inetsrv/ndp.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/ndp.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2013 Antonin Steinhauser
  * All rights reserved.
@@ -37,8 +36,7 @@
 
 #include <errno.h>
-#include <inet/eth_addr.h>
-#include <io/log.h>
 #include <mem.h>
 #include <stdlib.h>
+#include <io/log.h>
 #include "ntrans.h"
 #include "addrobj.h"
@@ -71,5 +69,5 @@
 	ndp_pdu_encode(packet, &dgram);
 
-	inet_link_send_dgram6(link, &packet->target_hw_addr, &dgram,
+	inet_link_send_dgram6(link, packet->target_hw_addr, &dgram,
 	    IP_PROTO_ICMPV6, INET6_HOP_LIMIT_MAX, 0);
 
@@ -110,5 +108,5 @@
 		if (laddr != NULL) {
 			rc = ntrans_add(packet.sender_proto_addr,
-			    &packet.sender_hw_addr);
+			    packet.sender_hw_addr);
 			if (rc != EOK)
 				return rc;
@@ -117,7 +115,7 @@
 
 			reply.opcode = ICMPV6_NEIGHBOUR_ADVERTISEMENT;
-			reply.sender_hw_addr = laddr->ilink->mac;
+			addr48(laddr->ilink->mac, reply.sender_hw_addr);
 			addr128(packet.target_proto_addr, reply.sender_proto_addr);
-			reply.target_hw_addr = packet.sender_hw_addr;
+			addr48(packet.sender_hw_addr, reply.target_hw_addr);
 			addr128(packet.sender_proto_addr, reply.target_proto_addr);
 
@@ -130,5 +128,5 @@
 		if (laddr != NULL)
 			return ntrans_add(packet.sender_proto_addr,
-			    &packet.sender_hw_addr);
+			    packet.sender_hw_addr);
 
 		break;
@@ -153,5 +151,5 @@
  *
  */
-errno_t ndp_translate(addr128_t src_addr, addr128_t ip_addr, eth_addr_t *mac_addr,
+errno_t ndp_translate(addr128_t src_addr, addr128_t ip_addr, addr48_t mac_addr,
     inet_link_t *ilink)
 {
@@ -169,8 +167,8 @@
 
 	packet.opcode = ICMPV6_NEIGHBOUR_SOLICITATION;
-	packet.sender_hw_addr = ilink->mac;
+	addr48(ilink->mac, packet.sender_hw_addr);
 	addr128(src_addr, packet.sender_proto_addr);
 	addr128(ip_addr, packet.solicited_ip);
-	eth_addr_solicited_node(ip_addr, &packet.target_hw_addr);
+	addr48_solicited_node(ip_addr, packet.target_hw_addr);
 	ndp_solicited_node_ip(ip_addr, packet.target_proto_addr);
 
Index: uspace/srv/net/inetsrv/ndp.h
===================================================================
--- uspace/srv/net/inetsrv/ndp.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/ndp.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2013 Antonin Steinhauser
  * All rights reserved.
@@ -40,5 +39,4 @@
 
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include "inetsrv.h"
 #include "icmpv6_std.h"
@@ -54,9 +52,9 @@
 	ndp_opcode_t opcode;
 	/** Sender hardware address */
-	eth_addr_t sender_hw_addr;
+	addr48_t sender_hw_addr;
 	/** Sender protocol address */
 	addr128_t sender_proto_addr;
 	/** Target hardware address */
-	eth_addr_t target_hw_addr;
+	addr48_t target_hw_addr;
 	/** Target protocol address */
 	addr128_t target_proto_addr;
@@ -66,5 +64,5 @@
 
 extern errno_t ndp_received(inet_dgram_t *);
-extern errno_t ndp_translate(addr128_t, addr128_t, eth_addr_t *, inet_link_t *);
+extern errno_t ndp_translate(addr128_t, addr128_t, addr48_t, inet_link_t *);
 
 #endif
Index: uspace/srv/net/inetsrv/ntrans.c
===================================================================
--- uspace/srv/net/inetsrv/ntrans.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/ntrans.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2013 Antonin Steinhauser
  * All rights reserved.
@@ -39,5 +38,4 @@
 #include <errno.h>
 #include <fibril_synch.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink_srv.h>
 #include <stdlib.h>
@@ -75,5 +73,5 @@
  *
  */
-errno_t ntrans_add(addr128_t ip_addr, eth_addr_t *mac_addr)
+errno_t ntrans_add(addr128_t ip_addr, addr48_t mac_addr)
 {
 	inet_ntrans_t *ntrans;
@@ -85,5 +83,5 @@
 
 	addr128(ip_addr, ntrans->ip_addr);
-	ntrans->mac_addr = *mac_addr;
+	addr48(mac_addr, ntrans->mac_addr);
 
 	fibril_mutex_lock(&ntrans_list_lock);
@@ -136,5 +134,5 @@
  *
  */
-errno_t ntrans_lookup(addr128_t ip_addr, eth_addr_t *mac_addr)
+errno_t ntrans_lookup(addr128_t ip_addr, addr48_t mac_addr)
 {
 	fibril_mutex_lock(&ntrans_list_lock);
@@ -146,5 +144,5 @@
 
 	fibril_mutex_unlock(&ntrans_list_lock);
-	*mac_addr = ntrans->mac_addr;
+	addr48(ntrans->mac_addr, mac_addr);
 	return EOK;
 }
Index: uspace/srv/net/inetsrv/ntrans.h
===================================================================
--- uspace/srv/net/inetsrv/ntrans.h	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/ntrans.h	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2013 Antonin Steinhauser
  * All rights reserved.
@@ -39,7 +38,6 @@
 #define NTRANS_H_
 
+#include <inet/iplink_srv.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
-#include <inet/iplink_srv.h>
 
 /** Address translation table element */
@@ -47,10 +45,10 @@
 	link_t ntrans_list;
 	addr128_t ip_addr;
-	eth_addr_t mac_addr;
+	addr48_t mac_addr;
 } inet_ntrans_t;
 
-extern errno_t ntrans_add(addr128_t, eth_addr_t *);
+extern errno_t ntrans_add(addr128_t, addr48_t);
 extern errno_t ntrans_remove(addr128_t);
-extern errno_t ntrans_lookup(addr128_t, eth_addr_t *);
+extern errno_t ntrans_lookup(addr128_t, addr48_t);
 extern errno_t ntrans_wait_timeout(usec_t);
 
Index: uspace/srv/net/inetsrv/pdu.c
===================================================================
--- uspace/srv/net/inetsrv/pdu.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/inetsrv/pdu.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -40,5 +40,4 @@
 #include <errno.h>
 #include <fibril_synch.h>
-#include <inet/eth_addr.h>
 #include <io/log.h>
 #include <macros.h>
@@ -505,5 +504,5 @@
 
 	message->length = 1;
-	eth_addr_encode(&ndp->sender_hw_addr, message->mac);
+	addr48(ndp->sender_hw_addr, message->mac);
 
 	icmpv6_phdr_t phdr;
@@ -553,5 +552,5 @@
 
 	addr128_t_be2host(message->target_address, ndp->target_proto_addr);
-	eth_addr_decode(message->mac, &ndp->sender_hw_addr);
+	addr48(message->mac, ndp->sender_hw_addr);
 
 	return EOK;
Index: uspace/srv/net/loopip/loopip.c
===================================================================
--- uspace/srv/net/loopip/loopip.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/loopip/loopip.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -41,5 +41,4 @@
 #include <inet/iplink_srv.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include <io/log.h>
 #include <loc.h>
@@ -56,5 +55,5 @@
 static errno_t loopip_send6(iplink_srv_t *srv, iplink_sdu6_t *sdu);
 static errno_t loopip_get_mtu(iplink_srv_t *srv, size_t *mtu);
-static errno_t loopip_get_mac48(iplink_srv_t *srv, eth_addr_t *mac);
+static errno_t loopip_get_mac48(iplink_srv_t *srv, addr48_t *mac);
 static errno_t loopip_addr_add(iplink_srv_t *srv, inet_addr_t *addr);
 static errno_t loopip_addr_remove(iplink_srv_t *srv, inet_addr_t *addr);
@@ -232,5 +231,5 @@
 }
 
-static errno_t loopip_get_mac48(iplink_srv_t *src, eth_addr_t *mac)
+static errno_t loopip_get_mac48(iplink_srv_t *src, addr48_t *mac)
 {
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip_get_mac48()");
Index: uspace/srv/net/slip/slip.c
===================================================================
--- uspace/srv/net/slip/slip.c	(revision 8a9a41e01a710f4ef36a33613b89d0973f674280)
+++ uspace/srv/net/slip/slip.c	(revision 2ce943a86a6fbca13a3d2809d0aa9d9dcd1cf398)
@@ -1,4 +1,3 @@
 /*
- * Copyright (c) 2021 Jiri Svoboda
  * Copyright (c) 2013 Jakub Jermar
  * All rights reserved.
@@ -41,5 +40,4 @@
 #include <loc.h>
 #include <inet/addr.h>
-#include <inet/eth_addr.h>
 #include <inet/iplink_srv.h>
 #include <io/chardev.h>
@@ -64,5 +62,5 @@
 static errno_t slip_send6(iplink_srv_t *, iplink_sdu6_t *);
 static errno_t slip_get_mtu(iplink_srv_t *, size_t *);
-static errno_t slip_get_mac48(iplink_srv_t *, eth_addr_t *);
+static errno_t slip_get_mac48(iplink_srv_t *, addr48_t *);
 static errno_t slip_addr_add(iplink_srv_t *, inet_addr_t *);
 static errno_t slip_addr_remove(iplink_srv_t *, inet_addr_t *);
@@ -178,5 +176,5 @@
 }
 
-errno_t slip_get_mac48(iplink_srv_t *src, eth_addr_t *mac)
+errno_t slip_get_mac48(iplink_srv_t *src, addr48_t *mac)
 {
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "slip_get_mac48()");
