Index: contrib/arch/HelenOS.adl
===================================================================
--- contrib/arch/HelenOS.adl	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/HelenOS.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -6,17 +6,38 @@
 	inst ns ns;
 	
-	/* RAM disk */
-	inst rd rd;
+	/* Loader (clonable service) */
+	inst loader loader;
 	
-	/* Klog */
+	/* Block device */
+	inst bd bd;
+	
+	/* VFS server */
+	inst vfs vfs;
+	
+	/* Console */
+	inst console console;
+	
+	/* Kernel log */
 	inst klog klog;
 	
 	[/uspace/lib/libc/bind%ns]
+	[/uspace/lib/libc/bind%loader]
+	[/uspace/lib/libc/bind%bd]
+	[/uspace/lib/libc/bind%vfs]
+	[/uspace/lib/libc/bind%console]
+	[/uspace/lib/libc/bind%klog]
 	
-	[/usrpace/lib/libc/bind%rd]
-	bind rd:ns to ns:ns;
-	bind rd:dm_driver to devmap:dm_driver;
+	bind loader:ns to ns:ns;
 	
-	[/usrpace/lib/libc/bind%klog]
+	bind bd:ns to ns:ns;
+	bind bd:devmap_driver to devmap:devmap_driver;
+	
+	bind vfs:ns to ns:ns;
+	bind vfs:bd to bd:bd;
+	bind vfs:devmap_client to devmap:devmap_client;
+	bind vfs:device to console:console;
+	
+	bind console:ns to ns:ns;
+	
 	bind klog:ns to ns:ns;
 };
Index: contrib/arch/hadlbppp.py
===================================================================
--- contrib/arch/hadlbppp.py	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/hadlbppp.py	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -34,7 +34,12 @@
 import os
 
+INC, POST_INC, BLOCK_COMMENT, LINE_COMMENT, SYSTEM, ARCH, HEAD, BODY, NULL, \
+	INST, VAR, FIN, BIND, TO, SUBSUME, DELEGATE, IFACE, PROTOTYPE, PAR_LEFT, \
+	PAR_RIGHT, SIGNATURE, PROTOCOL, FRAME, PROVIDES, REQUIRES = range(25)
+
 def usage(prname):
 	"Print usage syntax"
-	print prname + " <OUTPUT>"
+	
+	print "%s <OUTPUT>" % prname
 
 def tabs(cnt):
@@ -48,12 +53,11 @@
 	if (trim):
 		token = token.strip(" \t")
-		if (token != ""):
-			tokens.append(token)
-	else:
+	
+	if (token != ""):
 		tokens.append(token)
 	
 	return tokens
 
-def split_tokens(string, delimiters, trim = False):
+def split_tokens(string, delimiters, trim = False, separate = False):
 	"Split string to tokens by delimiters, keep the delimiters"
 	
@@ -66,7 +70,13 @@
 			if (len(delim) > 0):
 				
-				if ((string[i:(i + len(delim))] == delim) and (i > 0)):
-					tokens = cond_append(tokens, string[last:i], trim)
-					last = i
+				if (string[i:(i + len(delim))] == delim):
+					if (separate):
+						tokens = cond_append(tokens, string[last:i], trim)
+						tokens = cond_append(tokens, delim, trim)
+						last = i + len(delim)
+					elif (i > 0):
+						tokens = cond_append(tokens, string[last:i], trim)
+						last = i
+					
 					i += len(delim) - 1
 					break
@@ -78,68 +88,1082 @@
 	return tokens
 
-def parse(fname, outf):
-	"Parse particular protocol"
-	
-	inf = file(fname, "r")
-	outf.write("### %s\n\n" % fname)
-	
-	tokens = split_tokens(inf.read(), ["\n", " ", "\t", "(", ")", "{", "}", "[", "/*", "*/", "#", "*", ";", "+", "||", "|", "!", "?"], True)
-	
-	empty = True
-	comment = False
-	lcomment = False
-	indent = 0
+def identifier(token):
+	"Check whether the token is an identifier"
+	
+	if (len(token) == 0):
+		return False
+	
+	for i, char in enumerate(token):
+		if (i == 0):
+			if ((not char.isalpha()) and (char != "_")):
+				return False
+		else:
+			if ((not char.isalnum()) and (char != "_")):
+				return False
+	
+	return True
+
+def descriptor(token):
+	"Check whether the token is an interface descriptor"
+	
+	parts = token.split(":")
+	if (len(parts) != 2):
+		return False
+	
+	return (identifier(parts[0]) and identifier(parts[1]))
+
+def word(token):
+	"Check whether the token is a word"
+	
+	if (len(token) == 0):
+		return False
+	
+	for i, char in enumerate(token):
+		if ((not char.isalnum()) and (char != "_") and (char != ".")):
+			return False
+	
+	return True
+
+def preproc_bp(name, tokens):
+	"Preprocess tentative statements in Behavior Protocol"
+	
+	result = []
+	i = 0
+	
+	while (i < len(tokens)):
+		if (tokens[i] == "tentative"):
+			if ((i + 1 < len(tokens)) and (tokens[i + 1] == "{")):
+				i += 2
+				start = i
+				level = 1
+				
+				while ((i < len(tokens)) and (level > 0)):
+					if (tokens[i] == "{"):
+						level += 1
+					elif (tokens[i] == "}"):
+						level -= 1
+					
+					i += 1
+				
+				if (level == 0):
+					result.append("(")
+					result.extend(preproc_bp(name, tokens[start:(i - 1)]))
+					result.append(")")
+					result.append("+")
+					result.append("NULL")
+					if (i < len(tokens)):
+						result.append(tokens[i])
+				else:
+					print "%s: Syntax error in tentative statement" % name
+			else:
+				print "%s: Unexpected token in tentative statement" % name
+		else:
+			result.append(tokens[i])
+		
+		i += 1
+	
+	return result
+
+def split_bp(protocol):
+	"Convert Behavior Protocol to tokens"
+	
+	return split_tokens(protocol, ["\n", " ", "\t", "(", ")", "{", "}", "*", ";", "+", "||", "|", "!", "?"], True, True)
+
+def extend_bp(name, tokens, iface):
+	"Add interface to incoming messages"
+	
+	result = []
+	i = 0
+	
+	while (i < len(tokens)):
+		result.append(tokens[i])
+		
+		if (tokens[i] == "?"):
+			if (i + 1 < len(tokens)):
+				i += 1
+				parts = tokens[i].split(".")
+				
+				if (len(parts) == 1):
+					result.append("%s.%s" % (iface, tokens[i]))
+				else:
+					result.append(tokens[i])
+			else:
+				print "%s: Unexpected end of protocol" % name
+		
+		i += 1
+	
+	return result
+
+def merge_bp(protocols):
+	"Merge several Behavior Protocols"
+	
+	if (len(protocols) > 1):
+		result = []
+		first = True
+		
+		for protocol in protocols:
+			if (first):
+				first = False
+			else:
+				result.append("|")
+			
+			result.append("(")
+			result.extend(protocol)
+			result.append(")")
+		
+		return result
+	
+	if (len(protocols) == 1):
+		return protocols[0]
+	
+	return []
+
+def parse_bp(name, tokens, base_indent):
+	"Parse Behavior Protocol"
+	
+	tokens = preproc_bp(name, tokens)
+	
+	indent = base_indent
+	output = ""
 	
 	for token in tokens:
-		if (comment):
-			if (token == "*/"):
-				comment = False
-			continue
-		
-		if ((not comment) and (token == "/*")):
-			comment = True
-			continue
-		
-		if (lcomment):
-			if (token == "\n"):
-				lcomment = False
-			continue
-		
-		if ((not lcomment) and (token == "#")):
-			lcomment = True
-			continue
-		
 		if (token == "\n"):
 			continue
 		
-		if (empty):
-			empty = False
-		
 		if ((token == ";") or (token == "+") or (token == "||") or (token == "|")):
-			outf.write(" %s\n" % token)
+			output += " %s" % token
 		elif (token == "("):
-			outf.write("%s%s\n" % (tabs(indent), token))
+			output += "\n%s%s" % (tabs(indent), token)
 			indent += 1
 		elif (token == ")"):
+			if (indent < base_indent):
+				print "%s: Too many parentheses" % name
+			
 			indent -= 1
-			outf.write("\n%s%s" % (tabs(indent), token))
+			output += "\n%s%s" % (tabs(indent), token)
 		elif (token == "{"):
-			outf.write(" %s\n" % token)
+			output += " %s" % token
 			indent += 1
 		elif (token == "}"):
+			if (indent < base_indent):
+				print "%s: Too many parentheses" % name
+			
 			indent -= 1
-			outf.write("\n%s%s" % (tabs(indent), token))
+			output += "\n%s%s" % (tabs(indent), token)
 		elif (token == "*"):
-			outf.write("%s" % token)
+			output += "%s" % token
+		elif ((token == "!") or (token == "?") or (token == "NULL")):
+			output += "\n%s%s" % (tabs(indent), token)
 		else:
-			outf.write("%s%s" % (tabs(indent), token))
-	
-	if (empty):
+			output += "%s" % token
+	
+	if (indent > base_indent):
+		print "%s: Missing parentheses" % name
+	
+	output = output.strip()
+	if (output == ""):
+		return "NULL"
+	
+	return output
+
+def get_iface(name):
+	"Get interface by name"
+	
+	global iface_properties
+	
+	if (name in iface_properties):
+		return iface_properties[name]
+	
+	return None
+
+def dump_frame(frame, outdir):
+	"Dump Behavior Protocol of a given frame"
+	
+	outname = os.path.join(outdir, "%s.bp" % frame['name'])
+	if (os.path.isfile(outname)):
+		print "%s: File already exists, overwriting" % outname
+	
+	protocols = []
+	if ('protocol' in frame):
+		protocols.append(frame['protocol'])
+	
+	if ('provides' in frame):
+		for provides in frame['provides']:
+			iface = get_iface(provides['iface'])
+			if (not iface is None):
+				if ('protocol' in iface):
+					protocols.append(extend_bp(outname, iface['protocol'], iface['name']))
+			else:
+				print "%s: Provided interface '%s' is undefined" % (frame['name'], provides['iface'])
+	
+	outf = file(outname, "w")
+	outf.write(parse_bp(outname, merge_bp(protocols), 0))
+	outf.close()
+
+def get_system_arch():
+	"Get system architecture"
+	
+	global arch_properties
+	
+	for arch, properties in arch_properties.items():
+		if ('system' in properties):
+			return properties
+	
+	return None
+
+def get_arch(name):
+	"Get architecture by name"
+	
+	global arch_properties
+	
+	if (name in arch_properties):
+		return arch_properties[name]
+	
+	return None
+
+def get_frame(name):
+	"Get frame by name"
+	
+	global frame_properties
+	
+	if (name in frame_properties):
+		return frame_properties[name]
+	
+	return None
+
+def create_null_bp(name, outdir):
+	"Create null frame protocol"
+	
+	outname = os.path.join(outdir, name)
+	if (not os.path.isfile(outname)):
+		outf = file(outname, "w")
 		outf.write("NULL")
-	
-	outf.write("\n\n\n")
+		outf.close()
+
+def dump_arch(arch, outdir):
+	"Dump architecture Behavior Protocol"
+	
+	outname = os.path.join(outdir, "%s.archbp" % arch['name'])
+	if (os.path.isfile(outname)):
+		print "%s: File already exists, overwriting" % outname
+	
+	outf = file(outname, "w")
+	
+	create_null_bp("null.bp", outdir)
+	outf.write("frame \"null.bp\"\n\n")
+	
+	if ('inst' in arch):
+		for inst in arch['inst']:
+			subarch = get_arch(inst['type'])
+			if (not subarch is None):
+				outf.write("instantiate %s from \"%s.archbp\"\n" % (inst['var'], inst['type']))
+				dump_arch(subarch, outdir)
+			else:
+				subframe = get_frame(inst['type'])
+				if (not subframe is None):
+					outf.write("instantiate %s from \"%s.bp\"\n" % (inst['var'], inst['type']))
+					dump_frame(subframe, outdir)
+				else:
+					print "%s: '%s' is neither architecture nor frame" % (arch['name'], inst['type'])
+		
+		outf.write("\n")
+	
+	if ('bind' in arch):
+		for bind in arch['bind']:
+			outf.write("bind %s.%s to %s.%s\n" % (bind['from'][0], bind['from'][1], bind['to'][0], bind['to'][1]))
+	
+	outf.close()
+
+def preproc_adl(raw, inarg):
+	"Preprocess %% statements in ADL"
+	
+	return raw.replace("%%", inarg)
+
+def parse_adl(base, root, inname, nested, indent):
+	"Parse Architecture Description Language"
+	
+	global output
+	global context
+	global architecture
+	global interface
+	global frame
+	global protocol
+	
+	global iface_properties
+	global frame_properties
+	global arch_properties
+	
+	global arg0
+	
+	if (nested):
+		parts = inname.split("%")
+		
+		if (len(parts) > 1):
+			inarg = parts[1]
+		else:
+			inarg = "%%"
+		
+		if (parts[0][0:1] == "/"):
+			path = os.path.join(base, ".%s" % parts[0])
+			nested_root = os.path.dirname(path)
+		else:
+			path = os.path.join(root, parts[0])
+			nested_root = root
+		
+		if (not os.path.isfile(path)):
+			print "%s: Unable to include file %s" % (inname, path)
+			return ""
+	else:
+		inarg = "%%"
+		path = inname
+		nested_root = root
+	
+	inf = file(path, "r")
+	
+	raw = preproc_adl(inf.read(), inarg)
+	tokens = split_tokens(raw, ["\n", " ", "\t", "(", ")", "{", "}", "[", "]", "/*", "*/", "#", ";"], True, True)
+	
+	for token in tokens:
+		
+		# Includes
+		
+		if (INC in context):
+			context.remove(INC)
+			parse_adl(base, nested_root, token, True, indent)
+			context.add(POST_INC)
+			continue
+		
+		if (POST_INC in context):
+			if (token != "]"):
+				print "%s: Expected ]" % inname
+			
+			context.remove(POST_INC)
+			continue
+		
+		# Comments and newlines
+		
+		if (BLOCK_COMMENT in context):
+			if (token == "*/"):
+				context.remove(BLOCK_COMMENT)
+			
+			continue
+		
+		if (LINE_COMMENT in context):
+			if (token == "\n"):
+				context.remove(LINE_COMMENT)
+			
+			continue
+		
+		# Any context
+		
+		if (token == "/*"):
+			context.add(BLOCK_COMMENT)
+			continue
+		
+		if (token == "#"):
+			context.add(LINE_COMMENT)
+			continue
+		
+		if (token == "["):
+			context.add(INC)
+			continue
+		
+		if (token == "\n"):
+			continue
+		
+		# "frame"
+		
+		if (FRAME in context):
+			if (NULL in context):
+				if (token != ";"):
+					print "%s: Expected ';' in frame '%s'" % (inname, frame)
+				else:
+					output += "%s\n" % token
+				
+				context.remove(NULL)
+				context.remove(FRAME)
+				frame = None
+				continue
+			
+			if (BODY in context):
+				if (PROTOCOL in context):
+					if (token == "{"):
+						indent += 1
+					elif (token == "}"):
+						indent -= 1
+					
+					if (indent == -1):
+						bp = split_bp(protocol)
+						protocol = None
+						
+						if (not frame in frame_properties):
+							frame_properties[frame] = {}
+						
+						if ('protocol' in frame_properties[frame]):
+							print "%s: Protocol for frame '%s' already defined" % (inname, frame)
+						else:
+							frame_properties[frame]['protocol'] = bp
+						
+						output += "\n%s" % tabs(2)
+						output += parse_bp(inname, bp, 2)
+						output += "\n%s" % token
+						indent = 0
+						
+						context.remove(PROTOCOL)
+						context.remove(BODY)
+						context.add(NULL)
+					else:
+						protocol += token
+					
+					continue
+				
+				if (REQUIRES in context):
+					if (FIN in context):
+						if (token != ";"):
+							print "%s: Expected ';' in frame '%s'" % (inname, frame)
+						else:
+							output += "%s" % token
+						
+						context.remove(FIN)
+						continue
+					
+					if (VAR in context):
+						if (not identifier(token)):
+							print "%s: Variable name expected in frame '%s'" % (inname, frame)
+						else:
+							if (not frame in frame_properties):
+								frame_properties[frame] = {}
+							
+							if (not 'requires' in frame_properties[frame]):
+								frame_properties[frame]['requires'] = []
+							
+							frame_properties[frame]['requires'].append({'iface': arg0, 'var': token})
+							arg0 = None
+							
+							output += "%s" % token
+						
+						context.remove(VAR)
+						context.add(FIN)
+						continue
+					
+					if ((token == "}") or (token[-1] == ":")):
+						context.remove(REQUIRES)
+					else:
+						if (not identifier(token)):
+							print "%s: Interface name expected in frame '%s'" % (inname, frame)
+						else:
+							arg0 = token
+							output += "\n%s%s " % (tabs(indent), token)
+						
+						context.add(VAR)
+						continue
+				
+				if (PROVIDES in context):
+					if (FIN in context):
+						if (token != ";"):
+							print "%s: Expected ';' in frame '%s'" % (inname, frame)
+						else:
+							output += "%s" % token
+						
+						context.remove(FIN)
+						continue
+					
+					if (VAR in context):
+						if (not identifier(token)):
+							print "%s: Variable name expected in frame '%s'" % (inname, frame)
+						else:
+							if (not frame in frame_properties):
+								frame_properties[frame] = {}
+							
+							if (not 'provides' in frame_properties[frame]):
+								frame_properties[frame]['provides'] = []
+							
+							frame_properties[frame]['provides'].append({'iface': arg0, 'var': token})
+							arg0 = None
+							
+							output += "%s" % token
+						
+						context.remove(VAR)
+						context.add(FIN)
+						continue
+					
+					if ((token == "}") or (token[-1] == ":")):
+						context.remove(PROVIDES)
+					else:
+						if (not identifier(token)):
+							print "%s: Interface name expected in frame '%s'" % (inname, frame)
+						else:
+							arg0 = token
+							output += "\n%s%s " % (tabs(indent), token)
+						
+						context.add(VAR)
+						continue
+				
+				if (token == "}"):
+					if (indent != 2):
+						print "%s: Wrong number of parentheses in frame '%s'" % (inname, frame)
+					else:
+						indent = 0
+						output += "\n%s" % token
+					
+					context.remove(BODY)
+					context.add(NULL)
+					continue
+				
+				if (token == "provides:"):
+					output += "\n%s%s" % (tabs(indent - 1), token)
+					context.add(PROVIDES)
+					protocol = ""
+					continue
+				
+				if (token == "requires:"):
+					output += "\n%s%s" % (tabs(indent - 1), token)
+					context.add(REQUIRES)
+					protocol = ""
+					continue
+				
+				if (token == "protocol:"):
+					output += "\n%s%s" % (tabs(indent - 1), token)
+					indent = 0
+					context.add(PROTOCOL)
+					protocol = ""
+					continue
+				
+				print "%s: Unknown token '%s' in frame '%s'" % (inname, token, frame)
+				continue
+			
+			if (HEAD in context):
+				if (token == "{"):
+					output += "%s" % token
+					indent += 2
+					context.remove(HEAD)
+					context.add(BODY)
+					continue
+				
+				if (token == ";"):
+					output += "%s\n" % token
+					context.remove(HEAD)
+					context.remove(FRAME)
+					continue
+				
+				print "%s: Unknown token '%s' in frame head '%s'" % (inname, token, frame)
+				
+				continue
+			
+			if (not identifier(token)):
+				print "%s: Expected frame name" % inname
+			else:
+				frame = token
+				output += "%s " % token
+				
+				if (not frame in frame_properties):
+					frame_properties[frame] = {}
+				
+				frame_properties[frame]['name'] = frame
+			
+			context.add(HEAD)
+			continue
+		
+		# "interface"
+		
+		if (IFACE in context):
+			if (NULL in context):
+				if (token != ";"):
+					print "%s: Expected ';' in interface '%s'" % (inname, interface)
+				else:
+					output += "%s\n" % token
+				
+				context.remove(NULL)
+				context.remove(IFACE)
+				interface = None
+				continue
+			
+			if (BODY in context):
+				if (PROTOCOL in context):
+					if (token == "{"):
+						indent += 1
+					elif (token == "}"):
+						indent -= 1
+					
+					if (indent == -1):
+						bp = split_bp(protocol)
+						protocol = None
+						
+						if (not interface in iface_properties):
+							iface_properties[interface] = {}
+						
+						if ('protocol' in iface_properties[interface]):
+							print "%s: Protocol for interface '%s' already defined" % (inname, interface)
+						else:
+							iface_properties[interface]['protocol'] = bp
+						
+						output += "\n%s" % tabs(2)
+						output += parse_bp(inname, bp, 2)
+						output += "\n%s" % token
+						indent = 0
+						
+						context.remove(PROTOCOL)
+						context.remove(BODY)
+						context.add(NULL)
+					else:
+						protocol += token
+					
+					continue
+				
+				if (PROTOTYPE in context):
+					if (FIN in context):
+						if (token != ";"):
+							print "%s: Expected ';' in interface '%s'" % (inname, interface)
+						else:
+							output += "%s" % token
+						
+						context.remove(FIN)
+						context.remove(PROTOTYPE)
+						continue
+					
+					if (PAR_RIGHT in context):
+						if (token == ")"):
+							output += "%s" % token
+							context.remove(PAR_RIGHT)
+							context.add(FIN)
+						else:
+							output += " %s" % token
+						
+						continue
+					
+					if (SIGNATURE in context):
+						output += "%s" % token
+						if (token == ")"):
+							context.remove(SIGNATURE)
+							context.add(FIN)
+						
+						context.remove(SIGNATURE)
+						context.add(PAR_RIGHT)
+						continue
+					
+					if (PAR_LEFT in context):
+						if (token != "("):
+							print "%s: Expected '(' in interface '%s'" % (inname, interface)
+						else:
+							output += "%s" % token
+						
+						context.remove(PAR_LEFT)
+						context.add(SIGNATURE)
+						continue
+					
+					if (not identifier(token)):
+						print "%s: Method identifier expected in interface '%s'" % (inname, interface)
+					else:
+						output += "%s" % token
+					
+					context.add(PAR_LEFT)
+					continue
+				
+				if (token == "}"):
+					if (indent != 2):
+						print "%s: Wrong number of parentheses in interface '%s'" % (inname, interface)
+					else:
+						indent = 0
+						output += "\n%s" % token
+					
+					context.remove(BODY)
+					context.add(NULL)
+					continue
+				
+				if ((token == "ipcarg_t") or (token == "unative_t")):
+					output += "\n%s%s " % (tabs(indent), token)
+					context.add(PROTOTYPE)
+					continue
+				
+				if (token == "protocol:"):
+					output += "\n%s%s" % (tabs(indent - 1), token)
+					indent = 0
+					context.add(PROTOCOL)
+					protocol = ""
+					continue
+				
+				print "%s: Unknown token '%s' in interface '%s'" % (inname, token, interface)
+				continue
+			
+			if (HEAD in context):
+				if (token == "{"):
+					output += "%s" % token
+					indent += 2
+					context.remove(HEAD)
+					context.add(BODY)
+					continue
+				
+				if (token == ";"):
+					output += "%s\n" % token
+					context.remove(HEAD)
+					context.remove(ARCH)
+					continue
+				
+				if (not word(token)):
+					print "%s: Expected word in interface head '%s'" % (inname, interface)
+				else:
+					output += "%s " % token
+				
+				continue
+			
+			if (not identifier(token)):
+				print "%s: Expected interface name" % inname
+			else:
+				interface = token
+				output += "%s " % token
+				
+				if (not interface in iface_properties):
+					iface_properties[interface] = {}
+				
+				iface_properties[interface]['name'] = interface
+			
+			context.add(HEAD)
+			continue
+		
+		# "architecture"
+		
+		if (ARCH in context):
+			if (NULL in context):
+				if (token != ";"):
+					print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+				else:
+					output += "%s\n" % token
+				
+				context.remove(NULL)
+				context.remove(ARCH)
+				context.discard(SYSTEM)
+				architecture = None
+				continue
+			
+			if (BODY in context):
+				if (DELEGATE in context):
+					if (FIN in context):
+						if (token != ";"):
+							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+						else:
+							output += "%s" % token
+						
+						context.remove(FIN)
+						context.remove(DELEGATE)
+						continue
+					
+					if (VAR in context):
+						if (not descriptor(token)):
+							print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture)
+						else:
+							if (not architecture in arch_properties):
+								arch_properties[architecture] = {}
+							
+							if (not 'delegate' in arch_properties[architecture]):
+								arch_properties[architecture]['delegate'] = []
+							
+							arch_properties[architecture]['delegate'].append({'from': arg0, 'to': token.split(":")})
+							arg0 = None
+							
+							output += "%s" % token
+						
+						context.add(FIN)
+						context.remove(VAR)
+						continue
+					
+					if (TO in context):
+						if (token != "to"):
+							print "%s: Expected 'to' in architecture '%s'" % (inname, architecture)
+						else:
+							output += "%s " % token
+						
+						context.add(VAR)
+						context.remove(TO)
+						continue
+					
+					if (not identifier(token)):
+						print "%s: Expected interface name in architecture '%s'" % (inname, architecture)
+					else:
+						output += "%s " % token
+						arg0 = token
+					
+					context.add(TO)
+					continue
+				
+				if (SUBSUME in context):
+					if (FIN in context):
+						if (token != ";"):
+							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+						else:
+							output += "%s" % token
+						
+						context.remove(FIN)
+						context.remove(SUBSUME)
+						continue
+					
+					if (VAR in context):
+						if (not identifier(token)):
+							print "%s: Expected interface name in architecture '%s'" % (inname, architecture)
+						else:
+							if (not architecture in arch_properties):
+								arch_properties[architecture] = {}
+							
+							if (not 'subsume' in arch_properties[architecture]):
+								arch_properties[architecture]['subsume'] = []
+							
+							arch_properties[architecture]['subsume'].append({'from': arg0.split(":"), 'to': token})
+							arg0 = None
+							
+							output += "%s" % token
+						
+						context.add(FIN)
+						context.remove(VAR)
+						continue
+					
+					if (TO in context):
+						if (token != "to"):
+							print "%s: Expected 'to' in architecture '%s'" % (inname, architecture)
+						else:
+							output += "%s " % token
+						
+						context.add(VAR)
+						context.remove(TO)
+						continue
+					
+					if (not descriptor(token)):
+						print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture)
+					else:
+						output += "%s " % token
+						arg0 = token
+					
+					context.add(TO)
+					continue
+				
+				if (BIND in context):
+					if (FIN in context):
+						if (token != ";"):
+							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+						else:
+							output += "%s" % token
+						
+						context.remove(FIN)
+						context.remove(BIND)
+						continue
+					
+					if (VAR in context):
+						if (not descriptor(token)):
+							print "%s: Expected second interface descriptor in architecture '%s'" % (inname, architecture)
+						else:
+							if (not architecture in arch_properties):
+								arch_properties[architecture] = {}
+							
+							if (not 'bind' in arch_properties[architecture]):
+								arch_properties[architecture]['bind'] = []
+							
+							arch_properties[architecture]['bind'].append({'from': arg0.split(":"), 'to': token.split(":")})
+							arg0 = None
+							
+							output += "%s" % token
+						
+						context.add(FIN)
+						context.remove(VAR)
+						continue
+					
+					if (TO in context):
+						if (token != "to"):
+							print "%s: Expected 'to' in architecture '%s'" % (inname, architecture)
+						else:
+							output += "%s " % token
+						
+						context.add(VAR)
+						context.remove(TO)
+						continue
+					
+					if (not descriptor(token)):
+						print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture)
+					else:
+						output += "%s " % token
+						arg0 = token
+					
+					context.add(TO)
+					continue
+				
+				if (INST in context):
+					if (FIN in context):
+						if (token != ";"):
+							print "%s: Expected ';' in architecture '%s'" % (inname, architecture)
+						else:
+							output += "%s" % token
+						
+						context.remove(FIN)
+						context.remove(INST)
+						continue
+					
+					if (VAR in context):
+						if (not identifier(token)):
+							print "%s: Expected instance name in architecture '%s'" % (inname, architecture)
+						else:
+							if (not architecture in arch_properties):
+								arch_properties[architecture] = {}
+							
+							if (not 'inst' in arch_properties[architecture]):
+								arch_properties[architecture]['inst'] = []
+							
+							arch_properties[architecture]['inst'].append({'type': arg0, 'var': token})
+							arg0 = None
+							
+							output += "%s" % token
+						
+						context.add(FIN)
+						context.remove(VAR)
+						continue
+					
+					if (not identifier(token)):
+						print "%s: Expected frame/architecture type in architecture '%s'" % (inname, architecture)
+					else:
+						output += "%s " % token
+						arg0 = token
+					
+					context.add(VAR)
+					continue
+				
+				if (token == "}"):
+					if (indent != 1):
+						print "%s: Wrong number of parentheses in architecture '%s'" % (inname, architecture)
+					else:
+						indent -= 1
+						output += "\n%s" % token
+					
+					context.remove(BODY)
+					context.add(NULL)
+					continue
+				
+				if (token == "inst"):
+					output += "\n%s%s " % (tabs(indent), token)
+					context.add(INST)
+					continue
+				
+				if (token == "bind"):
+					output += "\n%s%s " % (tabs(indent), token)
+					context.add(BIND)
+					continue
+				
+				if (token == "subsume"):
+					output += "\n%s%s " % (tabs(indent), token)
+					context.add(SUBSUME)
+					continue
+				
+				if (token == "delegate"):
+					output += "\n%s%s " % (tabs(indent), token)
+					context.add(DELEGATE)
+					continue
+				
+				print "%s: Unknown token '%s' in architecture '%s'" % (inname, token, architecture)
+				continue
+			
+			if (HEAD in context):
+				if (token == "{"):
+					output += "%s" % token
+					indent += 1
+					context.remove(HEAD)
+					context.add(BODY)
+					continue
+				
+				if (token == ";"):
+					output += "%s\n" % token
+					context.remove(HEAD)
+					context.remove(ARCH)
+					context.discard(SYSTEM)
+					continue
+				
+				if (not word(token)):
+					print "%s: Expected word in architecture head '%s'" % (inname, architecture)
+				else:
+					output += "%s " % token
+				
+				continue
+			
+			if (not identifier(token)):
+				print "%s: Expected architecture name" % inname
+			else:
+				architecture = token
+				output += "%s " % token
+				
+				if (not architecture in arch_properties):
+					arch_properties[architecture] = {}
+				
+				arch_properties[architecture]['name'] = architecture
+				
+				if (SYSTEM in context):
+					arch_properties[architecture]['system'] = True
+			
+			context.add(HEAD)
+			continue
+		
+		# "system architecture"
+		
+		if (SYSTEM in context):
+			if (token != "architecture"):
+				print "%s: Expected 'architecture'" % inname
+			else:
+				output += "%s " % token
+			
+			context.add(ARCH)
+			continue
+		
+		if (token == "frame"):
+			output += "\n%s " % token
+			context.add(FRAME)
+			continue
+		
+		if (token == "interface"):
+			output += "\n%s " % token
+			context.add(IFACE)
+			continue
+		
+		if (token == "system"):
+			output += "\n%s " % token
+			context.add(SYSTEM)
+			continue
+		
+		if (token == "architecture"):
+			output += "\n%s " % token
+			context.add(ARCH)
+			continue
+		
+		print "%s: Unknown token '%s'" % (inname, token)
+	
 	inf.close()
 
-def recursion(root, output, level):
+def open_adl(base, root, inname, outdir, outname):
+	"Open Architecture Description file"
+	
+	global output
+	global context
+	global architecture
+	global interface
+	global frame
+	global protocol
+	
+	global arg0
+	
+	output = ""
+	context = set()
+	architecture = None
+	interface = None
+	frame = None
+	protocol = None
+	arg0 = None
+	
+	parse_adl(base, root, inname, False, 0)
+	output = output.strip()
+	
+	if (output != ""):
+		if (os.path.isfile(outname)):
+			print "%s: File already exists, overwriting" % outname
+		
+		outf = file(outname, "w")
+		outf.write(output)
+		outf.close()
+	else:
+		if (os.path.isfile(outname)):
+			print "%s: File already exists, but should be empty" % outname
+
+def recursion(base, root, output, level):
 	"Recursive directory walk"
 	
@@ -147,13 +1171,20 @@
 		canon = os.path.join(root, name)
 		
-		if ((os.path.isfile(canon)) and (level > 0)):
+		if (os.path.isfile(canon)):
 			fcomp = split_tokens(canon, ["."])
-			if (fcomp[-1] == ".bp"):
-				parse(canon, outf)
+			cname = canon.split("/")
+			
+			if (fcomp[-1] == ".adl"):
+				output_path = os.path.join(output, cname[-1])
+				open_adl(base, root, canon, output, output_path)
 		
 		if (os.path.isdir(canon)):
-			recursion(canon, outf, level + 1)
+			recursion(base, canon, output, level + 1)
 
 def main():
+	global iface_properties
+	global frame_properties
+	global arch_properties
+	
 	if (len(sys.argv) < 2):
 		usage(sys.argv[0])
@@ -162,9 +1193,18 @@
 	path = os.path.abspath(sys.argv[1])
 	if (not os.path.isdir(path)):
-		print "<OUTPUT> is not a directory"
+		print "Error: <OUTPUT> is not a directory"
 		return
 	
-	recursion(".", path, 0)
-	
+	iface_properties = {}
+	frame_properties = {}
+	arch_properties = {}
+	
+	recursion(".", ".", path, 0)
+	
+	system_arch = get_system_arch()
+	
+	if (not system_arch is None):
+		dump_arch(system_arch, path)
+
 if __name__ == '__main__':
 	main()
Index: contrib/arch/kernel/kernel.adl
===================================================================
--- contrib/arch/kernel/kernel.adl	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/kernel/kernel.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -7,15 +7,16 @@
 		unative_t sys_klog(int fd, const void *buf, size_t size);
 	protocol:
-		?sys_klog*
+		?sys_klog
 };
 
 interface kernel_console {
 		/* Enable kernel console */
-		uintptr_t sys_debug_enable_console(void);
+		unative_t sys_debug_enable_console(void);
 		
 		/* Disable kernel console */
-		uintptr_t sys_debug_disable_console(void);
-	protocol:
-		(?sys_debug_enable_console + ?sys_debug_disable_console)*
+		unative_t sys_debug_disable_console(void);
+	protocol:
+		?sys_debug_enable_console +
+		?sys_debug_disable_console
 };
 
@@ -24,5 +25,5 @@
 		unative_t sys_tls_set(unative_t addr);
 	protocol:
-		?sys_tls_set*
+		?sys_tls_set
 };
 
@@ -37,5 +38,9 @@
 		unative_t sys_thread_get_id(thread_id_t *uspace_thread_id);
 	protocol:
-		(?sys_thread_create + ?sys_thread_get_id)* ; ?sys_thread_exit
+		(
+			?sys_thread_create +
+			?sys_thread_get_id
+		)* ;
+		?sys_thread_exit
 };
 
@@ -47,5 +52,6 @@
 		unative_t sys_task_get_id(task_id_t *uspace_task_id);
 	protocol:
-		(?sys_task_set_name + ?sys_task_get_id)*
+		?sys_task_set_name +
+		?sys_task_get_id
 };
 
@@ -54,5 +60,5 @@
 		unative_t sys_program_spawn_loader(char *uspace_name, size_t name_len);
 	protocol:
-		?sys_program_spawn_loader*
+		?sys_program_spawn_loader
 };
 
@@ -64,5 +70,6 @@
 		unative_t sys_futex_wakeup(uintptr_t uaddr);
 	protocol:
-		(?sys_futex_sleep_timeout + ?sys_futex_wakeup)*
+		?sys_futex_sleep_timeout +
+		?sys_futex_wakeup
 };
 
@@ -71,5 +78,5 @@
 		unative_t sys_smc_coherence(uintptr_t va, size_t size);
 	protocol:
-		?sys_smc_coherence*
+		?sys_smc_coherence
 };
 
@@ -87,5 +94,8 @@
 		unative_t sys_as_area_destroy(uintptr_t address);
 	protocol:
-		(?sys_as_area_create + ?sys_as_area_resize + ?sys_as_area_change_flags + ?sys_as_area_destroy)*
+		?sys_as_area_create +
+		?sys_as_area_resize +
+		?sys_as_area_change_flags +
+		?sys_as_area_destroy
 };
 
@@ -124,5 +134,15 @@
 		unative_t sys_ipc_poke(void);
 	protocol:
-		(?sys_ipc_call_sync_fast + ?sys_ipc_call_sync_slow + ?sys_ipc_call_async_fast + ?sys_ipc_call_async_slow + ?sys_ipc_forward_fast + ?sys_ipc_forward_slow + ?sys_ipc_answer_fast + ?sys_ipc_answer_slow + ?sys_ipc_hangup + ?sys_ipc_wait_for_call + ?sys_ipc_poke)*
+		?sys_ipc_call_sync_fast +
+		?sys_ipc_call_sync_slow +
+		?sys_ipc_call_async_fast +
+		?sys_ipc_call_async_slow +
+		?sys_ipc_forward_fast +
+		?sys_ipc_forward_slow +
+		?sys_ipc_answer_fast +
+		?sys_ipc_answer_slow +
+		?sys_ipc_hangup +
+		?sys_ipc_wait_for_call +
+		?sys_ipc_poke
 };
 
@@ -131,5 +151,5 @@
 		unative_t sys_event_subscribe(unative_t evno, unative_t method);
 	protocol:
-		?sys_event_subscribe*
+		?sys_event_subscribe
 };
 
@@ -141,5 +161,6 @@
 		unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps);
 	protocol:
-		(?sys_cap_grant + ?sys_cap_rewoke)*
+		?sys_cap_grant +
+		?sys_cap_rewoke
 };
 
@@ -163,5 +184,10 @@
 		unative_t sys_ipc_unregister_irq(inr_t inr, devno_t devno);
 	protocol:
-		(?sys_enable_iospace + ?sys_physmem_map + ?sys_device_assign_devno + ?sys_preempt_control + ?sys_ipc_register_irq + ?sys_ipc_unregister_irq)*
+		?sys_enable_iospace +
+		?sys_physmem_map +
+		?sys_device_assign_devno +
+		?sys_preempt_control +
+		?sys_ipc_register_irq +
+		?sys_ipc_unregister_irq
 };
 
@@ -173,5 +199,6 @@
 		unative_t sys_sysinfo_value(unatice_t ptr, unative_t len);
 	protocol:
-		(?sys_sysinfo_valid + ?sys_sysinfo_value)*
+		?sys_sysinfo_valid +
+		?sys_sysinfo_value
 };
 
@@ -180,5 +207,5 @@
 		unative_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid_arg);
 	protocol:
-		?sys_ipc_connect_kbox*
+		?sys_ipc_connect_kbox
 };
 
Index: contrib/arch/uspace/lib/libc/bind
===================================================================
--- contrib/arch/uspace/lib/libc/bind	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/lib/libc/bind	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,3 +1,3 @@
-/* Bindings to kernel interfaces */
+/* Bind %% to kernel interfaces */
 bind %%:kernel_klog to kernel:kernel_klog;
 bind %%:kernel_console to kernel:kernel_console;
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,2 +1,4 @@
 [fnc.devmap_get_phone] ;
-!dm_client.device_get_count
+tentative {
+	!dm_client.device_get_count
+}
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,4 +1,6 @@
 [fnc.devmap_get_phone] ;
-!dm_client.device_get_devices {
-	!dm_client.ipc_m_data_read /* buffer */
+tentative {
+	!dm_client.device_get_devices {
+		!dm_client.ipc_m_data_read /* buffer */
+	}
 }
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,4 +1,6 @@
 [fnc.devmap_get_phone] ;
-!dm_client.device_get_handle {
-	!dm_client.ipc_m_data_write /* name */
+tentative {
+	!dm_client.device_get_handle {
+		!dm_client.ipc_m_data_write /* name */
+	}
 }
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_register
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_register	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_register	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,6 @@
+[fnc.devmap_get_phone] ;
+tentative {
+	!devmap.device_register {
+		!devmap.ipc_m_data_write /* name */
+	} ;
+}
Index: contrib/arch/uspace/lib/libc/fnc.devmap_driver_register
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_driver_register	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_driver_register	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,9 @@
+[fnc.devmap_get_phone] ;
+tentative {
+	!devmap.driver_register {
+		!devmap.ipc_m_data_write /* name */
+	} ;
+	tentative {
+		!devmap.ipc_m_connect_to_me
+	}
+}
Index: contrib/arch/uspace/lib/libc/subsume
===================================================================
--- contrib/arch/uspace/lib/libc/subsume	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libc/subsume	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,16 @@
+/* Subsume %% to kernel interfaces */
+subsume %%:kernel_klog to kernel_klog;
+subsume %%:kernel_console to kernel_console;
+subsume %%:kernel_tls to kernel_tls;
+subsume %%:kernel_thread to kernel_thread;
+subsume %%:kernel_task to kernel_task;
+subsume %%:kernel_program to kernel_program;
+subsume %%:kernel_futex to kernel_futex;
+subsume %%:kernel_smc to kernel_smc;
+subsume %%:kernel_as to kernel_as;
+subsume %%:kernel_ipc to kernel_sys;
+subsume %%:kernel_event to kernel_event;
+subsume %%:kernel_cap to kernel_cap;
+subsume %%:kernel_ddi to kernel_ddi;
+subsume %%:kernel_sysinfo to kernel_sysinfo;
+subsume %%:kernel_debug to kernel_debug;
Index: contrib/arch/uspace/lib/libfs/fnc.fs_register
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.fs_register	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libfs/fnc.fs_register	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,5 @@
+!vfs.register {
+	!vfs.ipc_m_data_write /* vfs_into_t */
+} ;
+!vfs.ipc_m_connect_to_me ;
+!vfs.ipc_m_share_in
Index: contrib/arch/uspace/lib/libfs/fnc.libfs_lookup
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.libfs_lookup	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libfs/fnc.libfs_lookup	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fs.lookup*
Index: contrib/arch/uspace/lib/libfs/fnc.libfs_mount
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.libfs_mount	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libfs/fnc.libfs_mount	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,6 @@
+?fs.ipc_m_connection_clone ;
+?fs.ipc_m_data_write /* mount options */ {
+	!fs.ipc_m_connect_to_me ;
+	!fs.mounted ;
+	!fs.ipc_m_data_write /* forward */
+}
Index: contrib/arch/uspace/lib/libfs/fnc.libfs_open_node
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.libfs_open_node	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libfs/fnc.libfs_open_node	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+NULL
Index: contrib/arch/uspace/lib/libfs/fnc.libfs_stat
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.libfs_stat	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/lib/libfs/fnc.libfs_stat	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+?fs.ipc_m_data_read
Index: ntrib/arch/uspace/lib/libfs/fs_register
===================================================================
--- contrib/arch/uspace/lib/libfs/fs_register	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!vfs.VFS_IN_REGISTER ;
-!vfs.IPC_M_DATA_WRITE /* vfs_into_t */ ;
-!vfs.IPC_M_CONNECT_TO_ME ;
-!vfs.IPC_M_SHARE_IN
Index: ntrib/arch/uspace/lib/libfs/libfs_lookup
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_lookup	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.VFS_OUT_LOOKUP*
Index: ntrib/arch/uspace/lib/libfs/libfs_mount
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_mount	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,6 +1,0 @@
-?fs.IPC_M_CONNECTION_CLONE ;
-?fs.IPC_M_DATA_WRITE /* mount options */ {
-	!fs.IPC_M_CONNECT_ME ;
-	!fs.VFS_OUT_MOUNTED ;
-	!fs.IPC_M_DATA_WRITE /* forwarded */
-}
Index: ntrib/arch/uspace/lib/libfs/libfs_stat
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_stat	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-?fs.IPC_M_DATA_READ
Index: contrib/arch/uspace/srv/bd/bd.adl
===================================================================
--- contrib/arch/uspace/srv/bd/bd.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/bd/bd.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,32 @@
+interface bd extends service {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Share out data buffer */
+		ipcarg_t ipc_m_share_out(in ipcarg_t as_area_base, in ipcarg_t as_area_size, in ipcarg_t flags, out ipcarg_t dst_as_area_base);
+		
+		/* Get block size */
+		ipcarg_t get_block_size(out ipcarg_t block_size);
+		
+		/* Read blocks via shared data buffer */
+		ipcarg_t read_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
+		
+		/* Write blocks via shared data buffer */
+		ipcarg_t write_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[bd.bp]
+};
+
+architecture bd {
+	inst rd rd;
+	
+	[/uspace/lib/libc/subsume%rd]
+	
+	delegate bd to rd:bd;
+	
+	subsume rd:ns to ns;
+	subsume rd:devmap to devmap;
+};
Index: contrib/arch/uspace/srv/bd/bd.bp
===================================================================
--- contrib/arch/uspace/srv/bd/bd.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/bd/bd.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,8 @@
+?ipc_m_connect_me_to ;
+?ipc_m_share_out ;
+(
+	?get_block_size +
+	?read_blocks +
+	?write_blocks
+)* ;
+?ipc_m_phone_hungup
Index: ntrib/arch/uspace/srv/bd/block_device.adl
===================================================================
--- contrib/arch/uspace/srv/bd/block_device.adl	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,21 +1,0 @@
-interface block_device extends service {
-		/* Establish connection */
-		ipcarg_t ipc_m_connect_me_to(void);
-		
-		/* Share out data buffer */
-		ipcarg_t ipc_m_share_out(in ipcarg_t as_area_base, in ipcarg_t as_area_size, in ipcarg_t flags, out ipcarg_t dst_as_area_base);
-		
-		/* Get block size */
-		ipcarg_t get_block_size(out ipcarg_t block_size);
-		
-		/* Read blocks via shared data buffer */
-		ipcarg_t read_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
-		
-		/* Write blocks via shared data buffer */
-		ipcarg_t write_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
-		
-		/* Close connection */
-		ipcarg_t ipc_m_phone_hungup(void);
-	protocol:
-		[block_device.bp]
-};
Index: ntrib/arch/uspace/srv/bd/block_device.bp
===================================================================
--- contrib/arch/uspace/srv/bd/block_device.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,8 +1,0 @@
-?ipc_m_connect_me_to ;
-?ipc_m_share_out ;
-(
-	?get_block_size +
-	?read_blocks +
-	?write_blocks
-)* ;
-?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/bd/rd/rd.adl
===================================================================
--- contrib/arch/uspace/srv/bd/rd/rd.adl	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/bd/rd/rd.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,9 +1,9 @@
 frame rd {
 	provides:
-		block_device bd;
+		bd bd;
 	requires:
-		naming_service ns;
-		device_mapper_driver dm_driver;
 		[/uspace/lib/libc/requires]
+		ns ns;
+		devmap_driver devmap_driver;
 	protocol:
 		[/uspace/lib/libc/protocol] +
Index: contrib/arch/uspace/srv/bd/rd/rd.bp
===================================================================
--- contrib/arch/uspace/srv/bd/rd/rd.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/bd/rd/rd.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,2 +1,2 @@
-[/lib/libc/fnc.devmap_driver_register] ;
-[/lib/libc/fnc.devmap_device_register]
+[/uspace/lib/libc/fnc.devmap_driver_register] ;
+[/uspace/lib/libc/fnc.devmap_device_register]
Index: ntrib/arch/uspace/srv/console/cell_mark_changed
===================================================================
--- contrib/arch/uspace/srv/console/cell_mark_changed	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,4 +1,0 @@
-(
-	[fb_pending_flush] +
-	NULL
-)
Index: ntrib/arch/uspace/srv/console/clear
===================================================================
--- contrib/arch/uspace/srv/console/clear	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CLEAR
Index: ntrib/arch/uspace/srv/console/cons_read
===================================================================
--- contrib/arch/uspace/srv/console/cons_read	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-?console.IPC_M_DATA_READ
Index: ntrib/arch/uspace/srv/console/cons_write
===================================================================
--- contrib/arch/uspace/srv/console/cons_write	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,3 +1,0 @@
-?console.IPC_M_DATA_WRITE ;
-[write_char]* ;
-[gcons_notify_char]
Index: contrib/arch/uspace/srv/console/console.bp
===================================================================
--- contrib/arch/uspace/srv/console/console.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/console/console.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -2,41 +2,41 @@
 !kbd.IPC_CONNECT_TO_ME ;
 !ns.IPC_CONNECT_ME_TO /* fb */ ;
-[devmap_driver_register] ;
+[/uspace/lib/libc/fnc.devmap_driver_register] ;
 !fb.FB_GET_RESOLUTION ;
 (
-	[vp_create] +
-	[vp_switch]
+	[fnc.vp_create] +
+	[fnc.vp_switch]
 )* ;
-[make_pixmap]* ;
-[make_anim] ;
-[vp_switch] ;
+[fnc.make_pixmap]* ;
+[fnc.make_anim] ;
+[fnc.vp_switch] ;
 !fb.FB_FLUSH ;
 !fb.FB_GET_CSIZE ;
 !fb.FB_GET_COLOR_CAP ;
 !fb.IPC_M_SHARE_OUT ;
-[devmap_device_register]* ;
-[gcons_redraw_console] ;
-[set_rgb_color] ;
-[screen_clear] ;
-[curs_goto] ;
-[curs_visibility] ;
+[/uspace/lib/libc/fnc.devmap_device_register]* ;
+[fnc.gcons_redraw_console] ;
+[fnc.set_rgb_color] ;
+[fnc.screen_clear] ;
+[fnc.curs_goto] ;
+[fnc.curs_visibility] ;
 (
 	?console.IPC_M_CONNECT_ME_TO ;
-	[gcons_notify_connect] ;
+	[fnc.gcons_notify_connect] ;
 	(
 		?console.VFS_OUT_READ {
-			[cons_read]
+			[fnc.cons_read]
 		} +
 		
 		?console.VFS_OUT_WRITE {
-			[cons_write]
+			[fnc.cons_write]
 		} +
 		
 		?console.VFS_OUT_SYNC {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
 				(
 					!fb.FB_FLUSH ;
-					[curs_goto]
+					[fnc.curs_goto]
 				) +
 				NULL
@@ -59,7 +59,7 @@
 		
 		?console.CONSOLE_SET_STYLE {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[set_style] +
+				[fnc.set_style] +
 				NULL
 			)
@@ -67,7 +67,7 @@
 		
 		?console.CONSOLE_SET_COLOR {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[set_color] +
+				[fnc.set_color] +
 				NULL
 			)
@@ -75,7 +75,7 @@
 		
 		?console.CONSOLE_SET_RGB_COLOR {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[set_rgb_color] +
+				[fnc.set_rgb_color] +
 				NULL
 			)
@@ -83,7 +83,7 @@
 		
 		?console.CONSOLE_CURSOR_VISIBILITY {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[curs_visibility] +
+				[fnc.curs_visibility] +
 				NULL
 			)
@@ -97,5 +97,5 @@
 	
 	?console.IPC_M_PHONE_HUNGUP {
-		[gcons_notify_disconnect]
+		[fnc.gcons_notify_disconnect]
 	}
 )*
Index: ntrib/arch/uspace/srv/console/curs_goto
===================================================================
--- contrib/arch/uspace/srv/console/curs_goto	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CURSOR_GOTO
Index: ntrib/arch/uspace/srv/console/curs_visibility
===================================================================
--- contrib/arch/uspace/srv/console/curs_visibility	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CURSOR_VISIBILITY
Index: ntrib/arch/uspace/srv/console/draw_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/draw_pixmap	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_PREPARE_SHM ;
-!fb.IPC_M_SHARE_OUT ;
-!fb.FB_DRAW_PPM ;
-!fb.FB_DROP_SHM
Index: ntrib/arch/uspace/srv/console/fb_pending_flush
===================================================================
--- contrib/arch/uspace/srv/console/fb_pending_flush	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_DRAW_TEXT_DATA
Index: contrib/arch/uspace/srv/console/fnc.cell_mark_changed
===================================================================
--- contrib/arch/uspace/srv/console/fnc.cell_mark_changed	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.cell_mark_changed	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,3 @@
+tentative {
+	[fnc.fb_pending_flush]
+}
Index: contrib/arch/uspace/srv/console/fnc.clear
===================================================================
--- contrib/arch/uspace/srv/console/fnc.clear	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.clear	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.clear
Index: contrib/arch/uspace/srv/console/fnc.cons_read
===================================================================
--- contrib/arch/uspace/srv/console/fnc.cons_read	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.cons_read	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+?ipc_m_data_read
Index: contrib/arch/uspace/srv/console/fnc.cons_write
===================================================================
--- contrib/arch/uspace/srv/console/fnc.cons_write	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.cons_write	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,3 @@
+?ipc_m_data_write ;
+[fnc.write_char]* ;
+[fnc.gcons_notify_char]
Index: contrib/arch/uspace/srv/console/fnc.curs_goto
===================================================================
--- contrib/arch/uspace/srv/console/fnc.curs_goto	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.curs_goto	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.cursor_goto
Index: contrib/arch/uspace/srv/console/fnc.curs_visibility
===================================================================
--- contrib/arch/uspace/srv/console/fnc.curs_visibility	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.curs_visibility	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.cursor_visibility
Index: contrib/arch/uspace/srv/console/fnc.draw_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/fnc.draw_pixmap	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.draw_pixmap	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,4 @@
+!fb.prepare_shm ;
+!fb.ipc_m_share_out ;
+!fb.draw_ppm ;
+!fb.drop_shm
Index: contrib/arch/uspace/srv/console/fnc.fb_pending_flush
===================================================================
--- contrib/arch/uspace/srv/console/fnc.fb_pending_flush	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.fb_pending_flush	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.draw_text_data
Index: contrib/arch/uspace/srv/console/fnc.gcons_notify_char
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_notify_char	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.gcons_notify_char	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,4 @@
+tentative {
+	[fnc.redraw_state] ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.gcons_notify_connect
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_notify_connect	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.gcons_notify_connect	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,4 @@
+tentative {
+	[fnc.redraw_state] ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.gcons_notify_disconnect
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_notify_disconnect	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.gcons_notify_disconnect	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,4 @@
+tentative {
+	[fnc.redraw_state] ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.gcons_redraw_console
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_redraw_console	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.gcons_redraw_console	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,9 @@
+tentative {
+	[fnc.vp_switch] ;
+	[fnc.set_rgb_color] ;
+	[fnc.clear] ;
+	[fnc.draw_pixmap] ;
+	[fnc.draw_pixmap] ;
+	[fnc.redraw_state]* ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.make_anim
===================================================================
--- contrib/arch/uspace/srv/console/fnc.make_anim	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.make_anim	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,4 @@
+!fb.anim_create ;
+[fnc.make_pixmap]* ;
+!fb.anim_add_pixmap ;
+!fb.anim_start
Index: contrib/arch/uspace/srv/console/fnc.make_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/fnc.make_pixmap	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.make_pixmap	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,4 @@
+!fb.prepare_shm ;
+!fb.ipc_m_share_out ;
+!fb.shm2pixmap ;
+!fb.drop_shm
Index: contrib/arch/uspace/srv/console/fnc.redraw_state
===================================================================
--- contrib/arch/uspace/srv/console/fnc.redraw_state	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.redraw_state	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,7 @@
+[fnc.vp_switch] ;
+tentative {
+	!fb.FB_VP_DRAW_PIXMAP
+} ;
+tentative {
+	!fb.FB_PUTCHAR*
+}
Index: contrib/arch/uspace/srv/console/fnc.screen_clear
===================================================================
--- contrib/arch/uspace/srv/console/fnc.screen_clear	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.screen_clear	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.clear
Index: contrib/arch/uspace/srv/console/fnc.set_color
===================================================================
--- contrib/arch/uspace/srv/console/fnc.set_color	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.set_color	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.set_color
Index: contrib/arch/uspace/srv/console/fnc.set_rgb_color
===================================================================
--- contrib/arch/uspace/srv/console/fnc.set_rgb_color	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.set_rgb_color	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.set_rgb_color
Index: contrib/arch/uspace/srv/console/fnc.set_style
===================================================================
--- contrib/arch/uspace/srv/console/fnc.set_style	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.set_style	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.set_style
Index: contrib/arch/uspace/srv/console/fnc.vp_create
===================================================================
--- contrib/arch/uspace/srv/console/fnc.vp_create	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.vp_create	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.viewport_create
Index: contrib/arch/uspace/srv/console/fnc.vp_switch
===================================================================
--- contrib/arch/uspace/srv/console/fnc.vp_switch	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.vp_switch	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fb.viewport_switch
Index: contrib/arch/uspace/srv/console/fnc.write_char
===================================================================
--- contrib/arch/uspace/srv/console/fnc.write_char	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/console/fnc.write_char	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,13 @@
+(
+	[fnc.fb_pending_flush] +
+	[fnc.cell_mark_changed]
+) ;
+tentative {
+	[fnc.fb_pending_flush] ;
+	tentative {
+		!fb.scroll +
+	}
+} ;
+tentative {
+	[fnc.curs_goto]
+}
Index: ntrib/arch/uspace/srv/console/gcons_notify_connect
===================================================================
--- contrib/arch/uspace/srv/console/gcons_notify_connect	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,5 +1,0 @@
-(
-	[redraw_state] ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/arch/uspace/srv/console/gcons_notify_disconnect
===================================================================
--- contrib/arch/uspace/srv/console/gcons_notify_disconnect	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,5 +1,0 @@
-(
-	[redraw_state] ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/arch/uspace/srv/console/gcons_redraw_console
===================================================================
--- contrib/arch/uspace/srv/console/gcons_redraw_console	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,10 +1,0 @@
-(
-	[vp_switch] ;
-	[set_rgb_color] ;
-	[clear] ;
-	[draw_pixmap] ;
-	[draw_pixmap] ;
-	[redraw_state]* ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/arch/uspace/srv/console/make_anim
===================================================================
--- contrib/arch/uspace/srv/console/make_anim	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_ANIM_CREATE ;
-[make_pixmap]* ;
-!fb.FB_ANIM_ADDPIXMAP ;
-!fb.FB_ANIM_START
Index: ntrib/arch/uspace/srv/console/make_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/make_pixmap	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_PREPARE_SHM ;
-!fb.IPC_M_SHARE_OUT ;
-!fb.FB_SHM2PIXMAP ;
-!fb.FB_DROP_SHM
Index: ntrib/arch/uspace/srv/console/redraw_state
===================================================================
--- contrib/arch/uspace/srv/console/redraw_state	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,11 +1,0 @@
-[vp_switch] ;
-(
-	!fb.FB_VP_DRAW_PIXMAP +
-	NULL
-) ;
-(
-	(
-		!fb.FB_PUTCHAR*
-	) +
-	NULL
-)
Index: ntrib/arch/uspace/srv/console/screen_clear
===================================================================
--- contrib/arch/uspace/srv/console/screen_clear	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CLEAR
Index: ntrib/arch/uspace/srv/console/set_color
===================================================================
--- contrib/arch/uspace/srv/console/set_color	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_COLOR
Index: ntrib/arch/uspace/srv/console/set_rgb_color
===================================================================
--- contrib/arch/uspace/srv/console/set_rgb_color	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_RGB_COLOR
Index: ntrib/arch/uspace/srv/console/set_style
===================================================================
--- contrib/arch/uspace/srv/console/set_style	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_STYLE
Index: ntrib/arch/uspace/srv/console/vp_create
===================================================================
--- contrib/arch/uspace/srv/console/vp_create	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_VIEWPORT_CREATE
Index: ntrib/arch/uspace/srv/console/vp_switch
===================================================================
--- contrib/arch/uspace/srv/console/vp_switch	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_VIEWPORT_SWITCH
Index: ntrib/arch/uspace/srv/console/write_char
===================================================================
--- contrib/arch/uspace/srv/console/write_char	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,18 +1,0 @@
-(
-	[fb_pending_flush] +
-	[cell_mark_changed]
-) ;
-(
-	(
-		[fb_pending_flush] ;
-		(
-			!fb.FB_SCROLL +
-			NULL
-		)
-	) +
-	NULL
-) ;
-(
-	[curs_goto] +
-	NULL
-)
Index: ntrib/arch/uspace/srv/devmap/device_mapper_client.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/device_mapper_client.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,21 +1,0 @@
-?ipc_m_connect_me_to ;
-
-!service.ipc_m_connect_me_to /* forward */
-+
-(
-	(
-		?device_get_handle {
-			?ipc_m_data_write /* device name */
-		} +
-		
-		?device_get_name +
-		?device_null_create +
-		?device_null_destroy +
-		?device_get_count +
-		
-		?device_get_devices {
-			?ipc_m_data_read /* buffer */
-		}
-	)*
-) ;
-?ipc_m_phone_hungup
Index: ntrib/arch/uspace/srv/devmap/device_mapper_driver.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/device_mapper_driver.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,22 +1,0 @@
-?ipc_m_connect_me_to ;
-?driver_register {
-	tentative {
-		?ipc_m_data_write /* driver name */
-	}
-} ;
-(
-	?device_register {
-		tentative {
-			?ipc_m_data_write /* device name */
-		}
-	} +
-	
-	?device_get_handle {
-		?ipc_m_data_write /* device name */
-	} +
-	
-	?device_get_name +
-	?device_unregister +
-	?driver_unregister
-)* ;
-?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/devmap/devmap.adl
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap.adl	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/devmap/devmap.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,8 +1,8 @@
-interface device_mapper_driver {
+interface devmap_driver {
 		/* Establish connection (iface is DEVMAP_DRIVER) */
 		ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface);
 		
 		/* Register as a new driver */
-		ipcarg_t driver_register(void);
+		ipcarg_t driver_register(in_copy string name);
 		
 		/* Unregister all devices and the driver itself */
@@ -10,5 +10,5 @@
 		
 		/* Register new device and return handle */
-		ipcarg_t device_register(out ipcarg_t handle);
+		ipcarg_t device_register(in_copy string name, out ipcarg_t handle);
 		
 		/* Unregister device */
@@ -16,24 +16,21 @@
 		
 		/* Resolve device name to handle */
-		ipcarg_t device_get_handle(in ipcarg_t flags);
+		ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
 		
 		/* Get device name for a given handle */
 		ipcarg_t device_get_name(in ipcarg_t handle);
 		
-		/* Transfer driver or device name */
-		ipcarg_t ipc_m_data_write(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
-		
 		/* Close connection */
 		ipcarg_t ipc_m_phone_hungup(void);
 	protocol:
-		[device_mapper_driver.bp]
+		[devmap_driver.bp]
 };
 
-interface device_mapper_client {
+interface devmap_client {
 		/* Establish connection (iface is DEVMAP_CLIENT) or forward to device (iface is DEVMAP_CONNECT_TO_DEVICE) */
 		ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface, in ipcarg_t handle);
 		
 		/* Resolve device name to handle */
-		ipcarg_t device_get_handle(in ipcarg_t flags);
+		ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
 		
 		/* Get device name for a given handle */
@@ -50,16 +47,10 @@
 		
 		/* Get an array of (device_name, handle) pairs */
-		ipcarg_t device_get_devices(void)
-		
-		/* Transfer device name from client */
-		ipcarg_t ipc_m_data_write(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
-		
-		/* Transfer (device_name, handle) pairs to client */
-		ipcarg_t ipc_m_data_read(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
+		ipcarg_t device_get_devices(out_copy stream data);
 		
 		/* Close connection */
 		ipcarg_t ipc_m_phone_hungup(void);
 	protocol:
-		[device_mapper_client.bp]
+		[devmap_client.bp]
 	
 };
@@ -67,9 +58,9 @@
 frame devmap {
 	provides:
-		device_mapper_driver dm_driver;
-		device_mapper_client dm_client;
+		devmap_driver devmap_driver;
+		devmap_client devmap_client;
 	requires:
-		[/lib/libc/iface.requires]
+		[/uspace/lib/libc/requires]
 	protocol:
-		[devmap.bp]
+		[devmap_server.bp]
 };
Index: ntrib/arch/uspace/srv/devmap/devmap.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!ns.ipc_m_connect_to_me
Index: contrib/arch/uspace/srv/devmap/devmap_client.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap_client.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/devmap/devmap_client.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,21 @@
+?ipc_m_connect_me_to ;
+
+!service.ipc_m_connect_me_to /* forward */
++
+(
+	(
+		?device_get_handle {
+			?ipc_m_data_write /* device name */
+		} +
+		
+		?device_get_name +
+		?device_null_create +
+		?device_null_destroy +
+		?device_get_count +
+		
+		?device_get_devices {
+			?ipc_m_data_read /* buffer */
+		}
+	)*
+) ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/devmap/devmap_driver.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap_driver.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/devmap/devmap_driver.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,22 @@
+?ipc_m_connect_me_to ;
+?driver_register {
+	tentative {
+		?ipc_m_data_write /* driver name */
+	}
+} ;
+(
+	?device_register {
+		tentative {
+			?ipc_m_data_write /* device name */
+		}
+	} +
+	
+	?device_get_handle {
+		?ipc_m_data_write /* device name */
+	} +
+	
+	?device_get_name +
+	?device_unregister +
+	?driver_unregister
+)* ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/devmap/devmap_server.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/devmap/devmap_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!ns.ipc_m_connect_to_me /* devmap */
Index: contrib/arch/uspace/srv/fs/devfs/devfs.adl
===================================================================
--- contrib/arch/uspace/srv/fs/devfs/devfs.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/fs/devfs/devfs.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,13 @@
+frame devfs {
+	provides:
+		fs fs;
+	requires:
+		[/uspace/lib/libc/requires]
+		vfs vfs;
+		ns ns;
+		devmap_client devmap_client;
+		service device;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[devfs_server.bp]
+};
Index: ntrib/arch/uspace/srv/fs/devfs/devfs.bp
===================================================================
--- contrib/arch/uspace/srv/fs/devfs/devfs.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,66 +1,0 @@
-[../../../lib/libc/devmap_get_phone] ;
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?fs.IPC_M_CONNECT_ME_TO ;
-	(
-		?fs.VFS_OUT_MOUNTED {
-			?fs.IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?fs.VFS_OUT_MOUNT +
-		
-		?fs.VFS_OUT_LOOKUP {
-			(
-				[../../../lib/libc/devmap_device_get_handle] ;
-				[../../../lib/libc/devmap_device_connect]
-			) +
-			NULL
-		} +
-		
-		?fs.VFS_OUT_READ {
-			?fs.IPC_M_DATA_READ /* payload */ {
-				(
-					!dev.VFS_OUT_READ ;
-					!dev.IPC_M_DATA_READ /* forwarded */
-				) +
-				(
-					[../../../lib/libc/devmap_device_get_count] ;
-					[../../../lib/libc/devmap_device_get_devices]
-				)
-			}
-		} +
-		
-		?fs.VFS_OUT_WRITE {
-			?fs.IPC_M_DATA_WRITE /* payload */ {
-				(
-					!dev.VFS_OUT_WRITE ;
-					!dev.IPC_M_DATA_WRITE /* forwarded */
-				)
-			} +
-			NULL
-		} +
-		
-		?fs.VFS_OUT_TRUNCATE +
-		
-		?fs.VFS_OUT_CLOSE {
-			!dev.IPC_M_PHONE_HUNGUP
-		} +
-		
-		?fs.VFS_OUT_DESTROY +
-		
-		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libc/devmap_device_connect] +
-			NULL
-		} +
-		
-		?fs.VFS_OUT_STAT {
-			?IPC_M_DATA_READ /* struct stat */
-		} +
-		
-		?fs.VFS_OUT_SYNC
-		
-	)* ;
-	?fs.IPC_M_PHONE_HUNGUP
-)* ;
-!vfs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/fs/devfs/devfs_server.bp
===================================================================
--- contrib/arch/uspace/srv/fs/devfs/devfs_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/fs/devfs/devfs_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,65 @@
+[/uspace/lib/libc/fnc.devmap_get_phone] ;
+!ns.ipc_m_connect_me_to /* vfs */ ;
+[/uspace/lib/libfs/fnc.fs_register] ;
+(
+	?fs.ipc_m_connect_me_to ;
+	(
+		?fs.mounted {
+			?fs.ipc_m_data_write /* mount options */
+		} +
+		
+		?fs.lookup {
+			tentative {
+				[/uspace/lib/libc/fnc.devmap_device_get_handle] ;
+				tentative {
+					[/uspace/lib/libc/fnc.devmap_device_connect]
+				}
+			}
+		} +
+		
+		?fs.open_node {
+			tentative {
+				[/uspace/lib/libc/fnc.devmap_device_connect]
+			}
+		} +
+		
+		?fs.read {
+			tentative {
+				?fs.ipc_m_data_read /* payload */ {
+					!device.read {
+						!device.ipc_m_data_read /* forward */
+					}
+				} +
+				(
+					[/uspace/lib/libc/fnc.devmap_device_get_count] ;
+					[/uspace/lib/libc/fnc.devmap_device_get_devices]
+				)
+			}
+		} +
+		
+		?fs.write {
+			tentative {
+				?fs.ipc_m_data_write /* payload */ {
+					!device.write {
+						!device.ipc_m_data_write /* forward */
+					}
+				}
+			}
+		} +
+		
+		?fs.stat {
+			?fs.ipc_m_data_read /* struct data */
+		} +
+		
+		?fs.close {
+			!device.ipc_m_phone_hungup
+		} +
+		
+		?fs.mount +
+		?fs.truncate +
+		?fs.destroy +
+		?fs.sync
+	)* ;
+	?fs.ipc_m_phone_hungup
+)* ;
+!vfs.ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/fs/fat/fat.adl
===================================================================
--- contrib/arch/uspace/srv/fs/fat/fat.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/fs/fat/fat.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,12 @@
+frame fat {
+	provides:
+		fs fs;
+	requires:
+		[/uspace/lib/libc/requires]
+		vfs vfs;
+		ns ns;
+		bd bd;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[fat_server.bp]
+};
Index: ntrib/arch/uspace/srv/fs/fat/fat.bp
===================================================================
--- contrib/arch/uspace/srv/fs/fat/fat.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,45 +1,0 @@
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?fs.IPC_M_CONNECT_ME_TO ;
-	(
-		?fs.VFS_OUT_MOUNTED {
-			?fs.IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?fs.VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
-		} +
-		
-		?fs.VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
-		} +
-		
-		?fs.VFS_OUT_READ {
-			?fs.IPC_M_DATA_READ /* payload */
-		} +
-		
-		?fs.VFS_OUT_WRITE {
-			?fs.IPC_M_DATA_WRITE /* payload */
-		} +
-		
-		?fs.VFS_OUT_TRUNCATE +
-		
-		?fs.VFS_OUT_CLOSE +
-		
-		?fs.VFS_OUT_DESTROY +
-		
-		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
-		} +
-		
-		?fs.VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
-		} +
-		
-		?fs.VFS_OUT_SYNC
-		
-	)* ;
-	?fs.IPC_M_PHONE_HUNGUP
-)* ;
-!vfs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/fs/fat/fat_server.bp
===================================================================
--- contrib/arch/uspace/srv/fs/fat/fat_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/fs/fat/fat_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,45 @@
+!ns.ipc_m_connect_me_to /* vfs */ ;
+[/uspace/lib/libfs/fnc.fs_register] ;
+(
+	?fs.ipc_m_connect_me_to ;
+	(
+		?fs.mounted {
+			?fs.ipc_m_data_write /* mount options */
+		} +
+		
+		?fs.mount {
+			[/uspace/lib/libfs/fnc.libfs_mount]
+		} +
+		
+		?fs.lookup {
+			[/uspace/lib/libfs/fnc.libfs_lookup]
+		} +
+		
+		?fs.open_node {
+			[/uspace/lib/libfs/fnc.libfs_open_node]
+		} +
+		
+		?fs.read {
+			tentative {
+				?fs.ipc_m_data_read /* payload */
+			}
+		} +
+		
+		?fs.write {
+			tentative {
+				?fs.ipc_m_data_write /* payload */
+			}
+		} +
+		
+		?fs.stat {
+			[/uspace/lib/libfs/fnc.libfs_stat]
+		} +
+		
+		?fs.truncate +
+		?fs.close +
+		?fs.destroy +
+		?fs.sync
+	)* ;
+	?fs.ipc_m_phone_hungup
+)* ;
+!vfs.ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/fs/tmpfs/tmpfs.adl
===================================================================
--- contrib/arch/uspace/srv/fs/tmpfs/tmpfs.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/fs/tmpfs/tmpfs.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,12 @@
+frame tmpfs {
+	provides:
+		fs fs;
+	requires:
+		[/uspace/lib/libc/requires]
+		vfs vfs;
+		ns ns;
+		bd bd;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[tmpfs_server.bp]
+};
Index: ntrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp
===================================================================
--- contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,45 +1,0 @@
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?fs.IPC_M_CONNECT_ME_TO ;
-	(
-		?fs.VFS_OUT_MOUNTED {
-			?fs.IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?fs.VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
-		} +
-		
-		?fs.VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
-		} +
-		
-		?fs.VFS_OUT_READ {
-			?fs.IPC_M_DATA_READ /* payload */
-		} +
-		
-		?fs.VFS_OUT_WRITE {
-			?fs.IPC_M_DATA_WRITE /* payload */
-		} +
-		
-		?fs.VFS_OUT_TRUNCATE +
-		
-		?fs.VFS_OUT_CLOSE +
-		
-		?fs.VFS_OUT_DESTROY +
-		
-		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
-		} +
-		
-		?fs.VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
-		} +
-		
-		?fs.VFS_OUT_SYNC
-		
-	)* ;
-	?fs.IPC_M_PHONE_HUNGUP
-)* ;
-!vfs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/fs/tmpfs/tmpfs_server.bp
===================================================================
--- contrib/arch/uspace/srv/fs/tmpfs/tmpfs_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/fs/tmpfs/tmpfs_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,45 @@
+!ns.ipc_m_connect_me_to /* vfs */ ;
+[/uspace/lib/libfs/fnc.fs_register] ;
+(
+	?fs.ipc_m_connect_me_to ;
+	(
+		?fs.mounted {
+			?fs.ipc_m_data_write /* mount options */
+		} +
+		
+		?fs.mount {
+			[/uspace/lib/libfs/fnc.libfs_mount]
+		} +
+		
+		?fs.lookup {
+			[/uspace/lib/libfs/fnc.libfs_lookup]
+		} +
+		
+		?fs.open_node {
+			[/uspace/lib/libfs/fnc.libfs_open_node]
+		} +
+		
+		?fs.read {
+			tentative {
+				?fs.ipc_m_data_read /* payload */
+			}
+		} +
+		
+		?fs.write {
+			tentative {
+				?fs.ipc_m_data_write /* payload */
+			}
+		} +
+		
+		?fs.stat {
+			[/uspace/lib/libfs/fnc.libfs_stat]
+		} +
+		
+		?fs.truncate +
+		?fs.close +
+		?fs.destroy +
+		?fs.sync
+	)* ;
+	?fs.ipc_m_phone_hungup
+)* ;
+!vfs.ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/kbd/event.bp
===================================================================
--- contrib/arch/uspace/srv/kbd/event.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/kbd/event.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+?event
Index: contrib/arch/uspace/srv/kbd/kbd.adl
===================================================================
--- contrib/arch/uspace/srv/kbd/kbd.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/kbd/kbd.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,37 @@
+interface kbd extends service {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Callback connection */
+		ipcarg_t ipc_m_connect_to_me(void);
+		
+		/* Yield hardware */
+		ipcarg_t yield(void);
+		
+		/* Reclaim hardware */
+		ipcarg_t reclaim(void);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[kbd.bp]
+};
+
+interface event {
+		/* Send keyboard event */
+		ipcarg_t event(in ipcarg_t type, in ipcarg_t key, in ipcarg_t mods, in ipcarg_t char);
+	protocol:
+		[event.bp]
+};
+
+frame kbd {
+	provides:
+		kbd kbd;
+	requires:
+		[/uspace/lib/libc/requires]
+		event event;
+		ns ns;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[kbd_server.bp]
+};
Index: contrib/arch/uspace/srv/kbd/kbd.bp
===================================================================
--- contrib/arch/uspace/srv/kbd/kbd.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/kbd/kbd.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,20 +1,7 @@
+?ipc_m_connect_me_to ;
 (
-	!ns.IPC_M_CONNECT_ME_TO /* cir */ +
-	NULL
-) ;
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?kbd.IPC_M_CONNECT_ME_TO ;
-	(
-		(
-			?kbd.KBD_YIELD +
-			?kbd.KBD_RECLAIM +
-		) |
-		!console.KBD_EVENT
-	)* ;
-	?kbd.IPC_M_PHONE_HUNGUP
+	?ipc_m_connect_to_me +
+	?yield +
+	?reclam
 )* ;
-(
-	!cir.IPC_M_PHONE_HUNGUP +
-	NULL
-)
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/kbd/kbd_server.bp
===================================================================
--- contrib/arch/uspace/srv/kbd/kbd_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/kbd/kbd_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,4 @@
+tentative {
+	!ns.ipc_m_connect_me_to /* cir */
+} ;
+!ns.ipc_m_connect_to_me /* kbd */
Index: contrib/arch/uspace/srv/loader/loader.adl
===================================================================
--- contrib/arch/uspace/srv/loader/loader.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/loader/loader.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,38 @@
+interface loader extends service {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Set task pathname */
+		ipcarg_t set_pathname(in_copy string pathname);
+		
+		/* Set task arguments */
+		ipcarg_t set_args(in_copy stream args);
+		
+		/* Set task initial files */
+		ipcarg_t set_files(in_copy stream files);
+		
+		/* Get task ID */
+		ipcarg_t get_taskid(out_copy stream id);
+		
+		/* Load binary */
+		ipcarg_t load(void);
+		
+		/* Run binary */
+		ipcarg_t run(void);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[loader.bp]
+};
+
+frame loader {
+	provides:
+		loader loader;
+	requires:
+		[/uspace/lib/libc/requires]
+		ns ns;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[loader_server.bp]
+};
Index: contrib/arch/uspace/srv/loader/loader.bp
===================================================================
--- contrib/arch/uspace/srv/loader/loader.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/loader/loader.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,25 +1,23 @@
-!ns.NS_ID_INTRO ;
-!ns.IPC_M_CONNECT_TO_ME ;
 (
-	?loader.LOADER_GET_TASKID {
-		?loader.IPC_M_DATA_READ /* task id */
+	?get_taskid {
+		?ipc_m_data_read /* task ID */
 	} +
 	
-	?loader.LOADER_SET_PATHNAME {
-		?loader.IPC_M_DATA_WRITE /* path */
+	?set_pathname {
+		?ipc_m_data_write /* pathname */
 	} +
 	
-	?loader.LOADER_SET_ARGS {
-		?loader.IPC_M_DATA_WRITE /* arguments */
+	?set_args {
+		?ipc_m_data_write /* arguments */
 	} +
 	
-	?loader.LOADER_SET_FILES {
-		?loader.IPC_M_DATA_WRITE /* files */
+	?set_files {
+		?ipc_m_data_write /* files */
 	} +
 	
-	?loader.LOADER_LOAD
+	?load
 )* ;
 (
-	?loader.LOADER_RUN +
-	?loader.IPC_M_PHONE_HUNGUP
+	?run +
+	?ipc_m_phone_hungup
 )
Index: contrib/arch/uspace/srv/loader/loader_server.bp
===================================================================
--- contrib/arch/uspace/srv/loader/loader_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/loader/loader_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,2 @@
+!ns.id_intro ;
+!ns.ipc_m_connect_to_me /* loader */
Index: ntrib/arch/uspace/srv/ns/naming_service.bp
===================================================================
--- contrib/arch/uspace/srv/ns/naming_service.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,23 +1,0 @@
-/* Every task has an implicit connection to the Naming Service,
-   thus there is no explicit ?ipc_m_connect_me_to */
-
-(
-	?ipc_m_connect_to_me {
-		tentative {
-			!loader.ipc_m_connect_to_me /* forward */
-		}
-	} +
-	
-	?ipc_m_connect_me_to {
-		tentative {
-			!service.ipc_m_connect_me_to /* forward */
-		}
-	} +
-	
-	?ipc_m_share_in +
-	?ping +
-	?task_wait +
-	?id_intro +
-	?retval
-)* ;
-?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/ns/ns.adl
===================================================================
--- contrib/arch/uspace/srv/ns/ns.adl	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/ns/ns.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,3 +1,3 @@
-interface naming_service {
+interface ns {
 		/* Register a clonable service or a generic service */
 		ipcarg_t ipc_m_connect_to_me(in ipcarg_t service);
@@ -24,10 +24,10 @@
 		ipcarg_t ipc_m_phone_hungup(void);
 	protocol:
-		[naming_service.bp]
+		[ns.bp]
 };
 
 frame ns {
 	provides:
-		naming_service ns;
+		ns ns;
 	requires:
 		[/uspace/lib/libc/requires]
Index: contrib/arch/uspace/srv/ns/ns.bp
===================================================================
--- contrib/arch/uspace/srv/ns/ns.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/ns/ns.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,23 @@
+/* Every task has an implicit connection to the Naming Service,
+   thus there is no explicit ?ipc_m_connect_me_to */
+
+(
+	?ipc_m_connect_to_me {
+		tentative {
+			!loader.ipc_m_connect_to_me /* forward */
+		}
+	} +
+	
+	?ipc_m_connect_me_to {
+		tentative {
+			!service.ipc_m_connect_me_to /* forward */
+		}
+	} +
+	
+	?ipc_m_share_in +
+	?ping +
+	?task_wait +
+	?id_intro +
+	?retval
+)* ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/pci/pci.adl
===================================================================
--- contrib/arch/uspace/srv/pci/pci.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/pci/pci.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,20 @@
+interface pci extends service {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[pci.bp]
+};
+
+frame pci {
+	provides:
+		pci pci;
+	requires:
+		[/uspace/lib/libc/requires]
+		ns ns;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[pci_server.bp]
+};
Index: contrib/arch/uspace/srv/pci/pci.bp
===================================================================
--- contrib/arch/uspace/srv/pci/pci.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/pci/pci.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,5 +1,2 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?pci.IPC_M_CONNECT_ME_TO ;
-	?pci.IPC_M_PHONE_HUNGUP
-)*
+?ipc_m_connect_me_to ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/pci/pci_server.bp
===================================================================
--- contrib/arch/uspace/srv/pci/pci_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/pci/pci_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!ns.ipc_m_connect_to_me /* pci */
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_grab_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_grab_phone	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_grab_phone	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fs.ipc_m_connect_me_to
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_lookup_internal
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_lookup_internal	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_lookup_internal	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,3 @@
+[fnc.vfs_grab_phone] ;
+!fs.lookup ;
+[fnc.vfs_release_phone]
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_open_node_internal
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_open_node_internal	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_open_node_internal	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,3 @@
+[fnc.vfs_grab_phone] ;
+!fs.open_node ;
+[fnc.vfs_release_phone]
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_release_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_release_phone	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_release_phone	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!fs.ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/vfs/vfs.adl
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/vfs/vfs.adl	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,137 @@
+interface vfs extends service {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Register a filesystem driver */
+		ipcarg_t register(in_copy string name);
+		
+		/* Mount filesystem */
+		ipcarg_t mount(in ipcarg_t device, in ipcarg_t flags, in_copy string point, in_copy string opts, in_copy string fs);
+		
+		/* Open file */
+		ipcarg_t open(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, in_copy string path, out ipcarg_t fd);
+		
+		/* Open file using node */
+		ipcarg_t open_node(in ipcarg_t fs_handle, in ipcarg_t dev_handle, in ipcarg_t index, in ipcarg_t oflag, out ipcarg_t fd);
+		
+		/* Read data from file */
+		ipcarg_t read(in ipcarg_t fd, out_copy stream data);
+		
+		/* Write data to file */
+		ipcarg_t write(in ipcarg_t fd, in_copy stream data);
+		
+		/* Seek in file */
+		ipcarg_t seek(in ipcarg_t fd, in ipcarg_t offset, in ipcarg_t whence);
+		
+		/* Truncate file */
+		ipcarg_t truncate(in ipcarg_t fd, in ipcarg_t size);
+		
+		/* Get file metadata */
+		ipcarg_t fstat(in ipcarg_t fd, out_copy stream stat);
+		
+		/* Get directory entry metadata */
+		ipcarg_t stat(in_copy string path, out_copy stream stat);
+		
+		/* Create directory */
+		ipcarg_t mkdir(in ipcarg_t mode, in_copy string path);
+		
+		/* Delete directory entry */
+		ipcarg_t unlink(in ipcarg_t lflag, in_copy string path);
+		
+		/* Rename directory entry */
+		ipcarg_t rename(in_copy string old, in_copy string new);
+		
+		/* Flush file buffers */
+		ipcarg_t sync(in ipcarg_t fd);
+		
+		/* In-protocol status value */
+		ipcarg_t ipc_m_ping(void);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[vfs.bp]
+};
+
+interface fs extends service {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Notify filesystem that it was mounted */
+		ipcarg_t mounted(in ipcarg_t dev_handle, in_copy string opts);
+		
+		/* Mount filesystem */
+		ipcarg_t mount(in ipcarg_t device, in ipcarg_t flags, in_copy string point, in_copy string opts, ...);
+		
+		/* Open file by node */
+		ipcarg_t open_node(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, ...);
+		
+		/* Lookup file */
+		ipcarg_t lookup(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, ...);
+		
+		/* Read data from file */
+		ipcarg_t read(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t offset, out_copy stream data);
+		
+		/* Write data to file */
+		ipcarg_t write(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t offset, out_copy stream data);
+		
+		/* Truncate file */
+		ipcarg_t truncate(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t size);
+		
+		/* Get directory entry metadata */
+		ipcarg_t stat(in ipcarg_t dev_handle, in ipcarg_t fs_index, out_copy stream stat);
+		
+		/* Flush file buffers */
+		ipcarg_t sync(in ipcarg_t dev_handle, in ipcarg_t fs_index);
+		
+		/* Notify on file close */
+		ipcarg_t close(in ipcarg_t dev_handle, in ipcarg_t fs_index);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+};
+
+frame vfs_manager {
+	provides:
+		vfs vfs;
+	requires:
+		[/uspace/lib/libc/requires]
+		fs fs;
+		ns ns;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[vfs_server.bp]
+};
+
+architecture vfs {
+	inst vfs_manager vfs;
+	inst tmpfs tmpfs;
+	inst fat fat;
+	inst devfs devfs;
+	
+	bind vfs:fs to tmpfs:fs;
+	bind vfs:fs to fat:fs;
+	bind vfs:fs to devfs:fs;
+	
+	bind tmpfs:vfs to vfs:vfs;
+	bind fat:vfs to vfs:vfs;
+	bind devfs:vfs to vfs:vfs;
+	
+	delegate vfs to vfs:vfs;
+	
+	[/uspace/lib/libc/subsume%vfs]
+	[/uspace/lib/libc/subsume%tmpfs]
+	[/uspace/lib/libc/subsume%fat]
+	[/uspace/lib/libc/subsume%devfs]
+	
+	subsume vfs:ns to ns;
+	subsume tmpfs:ns to ns;
+	subsume fat:ns to ns;
+	subsume devfs:ns to ns;
+	
+	subsume tmpfs:bd to bd;
+	subsume fat:bd to bd;
+	
+	subsume devfs:devmap_client to devmap_client;
+	subsume devfs:device to device;
+};
Index: contrib/arch/uspace/srv/vfs/vfs.bp
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs.bp	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/arch/uspace/srv/vfs/vfs.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -1,131 +1,179 @@
-!ns.IPC_M_CONNECT_TO_ME ;
+?ipc_m_connect_me_to ;
 (
-	?vfs.IPC_M_CONNECT_ME_TO ;
-	(
-		?vfs.VFS_IN_REGISTER {
-			?vfs.IPC_M_DATA_WRITE ;
-			?vfs.IPC_M_CONNECT_TO_ME ;
-			?vfs.IPC_M_SHARE_IN
-		} +
-		
-		?vfs.VFS_IN_MOUNT {
-			?vfs.IPC_M_DATA_WRITE /* mount point */ ;
-			?vfs.IPC_M_DATA_WRITE /* mount options */ ;
-			?vfs.IPC_M_DATA_WRITE /* fs name */ ;
-			?vfs.IPC_M_PING ;
-			(
-				
-				!fs.VFS_OUT_MOUNTED ;
-				!fs.IPC_M_DATA_WRITE /* mount options */
-			) /* root fs */ +
-			(
-				!fs.VFS_OUT_MOUNT ;
-				!fs.IPC_M_CONNECTION_CLONE ;
-				!fs.VFS_M_DATA_WRITE /* mount options */
-			) /* non-root fs */
-		} +
-		
-		?vfs.VFS_IN_OPEN {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal] ;
-			(
-				(
-					[vfs_grab_phone] ;
-					!fs.VFS_OUT_TRUNCATE ;
-					[vfs_release_phone]
-				) +
-				NULL
-			)
-		} +
-		
-		?vfs.VFS_IN_OPEN_NODE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_OPEN_NODE ;
-			[vfs_release_phone] ;
-			(
-				(
-					[vfs_grab_phone] ;
-					!fs.VFS_OUT_TRUNCATE ;
-					[vfs_release_phone]
-				) +
-				NULL
-			)
-		} +
-		
-		?vfs.VFS_IN_CLOSE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_CLOSE ;
-			[vfs_release_phone]
-		} +
-		
-		?vfs.VFS_IN_READ {
-			?vfs.IPC_M_DATA_READ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_READ /* payload */ ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
+	?register {
+		?ipc_m_data_write /* fs name */ ;
+		tentative {
+			/* callback connection */
+			?ipc_m_connect_to_me ;
+			?ipc_m_share_in
+		}
+	} +
+	
+	?mount {
+		?ipc_m_data_write /* mount point */ ;
+		tentative {
+			?ipc_m_data_write /* mount options */ ;
+			tentative {
+				?ipc_m_data_write /* fs name */ ;
+				tentative {
+					?ipc_m_ping ;
+					tentative {
+						(
+							/* root fs */
+							!fs.mounted ;
+							!fs.ipc_m_data_write /* mount options */
+						) +
+						(
+							/* non-root fs */
+							tentative {
+								[fnc.vfs_lookup_internal] ;
+								tentative {
+									[fnc.vfs_grab_phone] ;
+									[fnc.vfs_grab_phone] ;
+									!fs.mount ;
+									!fs.ipc_m_connection_clone ;
+									[fnc.vfs_release_phone] ;
+									tentative {
+										!fs.vfs_m_data_write /* mount options */
+									} ;
+									[fnc.vfs_release_phone]
+								}
+							}
+						)
+					}
+				}
 			}
-		} +
-		
-		?vfs.VFS_IN_WRITE {
-			?vfs.IPC_M_DATA_WRITE {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_WRITE /* payload */ ;
-				!fs.IPC_M_DATA_WRITE /* forwarded */ ;
-				[vfs_release_phone]
+		}
+	} +
+	
+	?open {
+		tentative {
+			?ipc_m_data_write /* path */ ;
+			tentative {
+				[fnc.vfs_lookup_internal] ;
+				tentative {
+					[fnc.vfs_grab_phone] ;
+					!fs.truncate ;
+					[fnc.vfs_release_phone]
+				}
 			}
-		} +
-		
-		?vfs.VFS_IN_SEEK +
-		
-		?vfs.VFS_IN_TRUNCATE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_TRUNCATE ;
-			[vfs_release_phone]
-		} +
-		
-		?vfs.VFS_IN_FSTAT {
-			?vfs.IPC_M_DATA_READ /* struct stat */ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
+		}
+	} +
+	
+	?open_node {
+		[fnc.vfs_open_node_internal] ;
+		tentative {
+			[fnc.vfs_grab_phone] ;
+			!fs.truncate ;
+			[fnc.vfs_release_phone]
+		}
+	} +
+	
+	?close {
+		tentative {
+			[fnc.vfs_grab_phone] ;
+			!fs.close ;
+			[fnc.vfs_release_phone]
+		}
+	} +
+	
+	?read {
+		tentative {
+			?ipc_m_data_read {
+				[fnc.vfs_grab_phone] ;
+				!fs.read ;
+				!fs.ipc_m_data_read /* forward payload */ ;
+				[fnc.vfs_release_phone]
 			}
-		} +
-		
-		?vfs.VFS_IN_STAT {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			?vfs.IPC_M_DATA_READ /* struct stat */ {
-				[vfs_lookup_internal] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */
+		}
+	} +
+	
+	?write {
+		tentative {
+			?ipc_m_data_write {
+				[fnc.vfs_grab_phone] ;
+				!fs.write ;
+				!fs.ipc_m_data_write /* forward payload */ ;
+				[fnc.vfs_release_phone]
 			}
-		} +
-		
-		?vfs.VFS_IN_MKDIR {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?vfs.VFS_IN_UNLINK {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?vfs.VFS_IN_RENAME {
-			?vfs.IPC_M_DATA_WRITE /* old path */ ;
-			?vfs.IPC_M_DATE_WRITE /* new path */ ;
-			[vfs_lookup_internal] /* lookup old path */ ;
-			[vfs_lookup_internal] /* lookup parent of new path */ ;
-			[vfs_lookup_internal] /* destroy old link for the new path */ ;
-			[vfs_lookup_internal] /* create new link for the new path */ ;
-			[vfs_lookup_internal] /* destroy link for the old path */
-		} +
-		
-		?vfs.VFS_IN_SYNC {
-			!fs.VFS_OUT_SYNC
 		}
-		
-	)* ;
-	?vfs.IPC_M_PHONE_HUNGUP
-)*
+	} +
+	
+	?truncate {
+		tentative {
+			[fnc.vfs_grab_phone] ;
+			!fs.truncate ;
+			[fnc.vfs_release_phone]
+		}
+	} +
+	
+	?fstat {
+		tentative {
+			?ipc_m_data_read /* struct stat */ {
+				[fnc.vfs_grab_phone] ;
+				!fs.stat ;
+				!fs.ipc_m_data_read /* forward struct stat */ ;
+				[fnc.vfs_release_phone]
+			}
+		}
+	} +
+	
+	?stat {
+		?ipc_m_data_write /* path */ ;
+		tentative {
+			?ipc_m_data_read /* struct stat */ {
+				[fnc.vfs_lookup_internal] ;
+				tentative {
+					!fs.stat ;
+					!fs.ipc_m_data_read /* forward struct stat */
+				}
+			}
+		}
+	} +
+	
+	?mkdir {
+		?ipc_m_data_write /* path */ ;
+		tentative {
+			[fnc.vfs_lookup_internal]
+		}
+	} +
+	
+	?unlink {
+		?ipc_m_data_write /* path */ ;
+		tentative {
+			[fnc.vfs_lookup_internal]
+		}
+	} +
+	
+	?rename {
+		?ipc_m_data_write /* old path */ ;
+		tentative {
+			?ipc_m_data_write /* new path */ ;
+			tentative {
+				[fnc.vfs_lookup_internal] /* lookup old path */ ;
+				tentative {
+					[fnc.vfs_lookup_internal] /* lookup parent of new path */ ;
+					tentative {
+						[fnc.vfs_lookup_internal] /* destroy old link for the new path */ ;
+						tentative {
+							[fnc.vfs_lookup_internal] /* create new link for the new path */ ;
+							tentative {
+								[fnc.vfs_lookup_internal] /* destroy link for the old path */
+							}
+						}
+					}
+				}
+			}
+		}
+	} +
+	
+	?sync {
+		tentative {
+			!fs.sync
+		}
+	} +
+	
+	?seek
+	
+)* ;
+?ipc_m_phne_hungup
Index: ntrib/arch/uspace/srv/vfs/vfs_grab_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_grab_phone	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.IPC_M_CONNECT_ME_TO
Index: ntrib/arch/uspace/srv/vfs/vfs_lookup_internal
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_lookup_internal	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,3 +1,0 @@
-[vfs_grab_phone] ;
-!fs.VFS_OUT_LOOKUP ;
-[vfs_release_phone]
Index: ntrib/arch/uspace/srv/vfs/vfs_release_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_release_phone	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/vfs/vfs_server.bp
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
+++ contrib/arch/uspace/srv/vfs/vfs_server.bp	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -0,0 +1,1 @@
+!ns.ipc_m_connect_to_me /* vfs */
Index: contrib/highlight/adl.syntax
===================================================================
--- contrib/highlight/adl.syntax	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/highlight/adl.syntax	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -18,8 +18,12 @@
 	
 	keyword whole ipcarg_t yellow
+	keyword whole string yellow
+	keyword whole stream yellow
 	keyword whole void yellow
 	
 	keyword whole in yellow
+	keyword whole in_copy yellow
 	keyword whole out yellow
+	keyword whole out_copy yellow
 	
 	keyword whole protocol yellow
Index: contrib/highlight/bp.syntax
===================================================================
--- contrib/highlight/bp.syntax	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ contrib/highlight/bp.syntax	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -4,6 +4,4 @@
 context default
 	keyword whole NULL yellow
-	keyword whole try yellow
-	keyword whole catch yellow
 	keyword whole tentative yellow
 	
Index: kernel/arch/ia64/_link.ld.in
===================================================================
--- kernel/arch/ia64/_link.ld.in	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ kernel/arch/ia64/_link.ld.in	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -7,8 +7,11 @@
  */
 
+#define LOAD_ADDRESS_V	0xe000000004404000
+#define LOAD_ADDRESS_P	0x0000000004404000
+
 ENTRY(kernel_image_start)
 
 SECTIONS {
-	.image 0xe000000004404000: AT (0x0000000004404000) { 
+	.image LOAD_ADDRESS_V: AT (LOAD_ADDRESS_P) {
 		ktext_start = .;
 		*(K_TEXT_START);
@@ -21,4 +24,10 @@
 		*(.opd)
 		*(.data .data.*)
+		hardcoded_load_address = .;
+		QUAD(LOAD_ADDRESS_V);
+		hardcoded_ktext_size = .;
+		QUAD(ktext_end - ktext_start);
+		hardcoded_kdata_size = .;
+		QUAD(kdata_end - kdata_start);
 		*(.got .got.*)
 		*(.sdata)
@@ -38,7 +47,3 @@
 	}
 
-	_hardcoded_ktext_size = ktext_end - ktext_start;
-	_hardcoded_kdata_size = kdata_end - kdata_start;
-	_hardcoded_load_address = 0xe000000004404000;
-
 }
Index: kernel/arch/ia64/src/ivt.S
===================================================================
--- kernel/arch/ia64/src/ivt.S	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ kernel/arch/ia64/src/ivt.S	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -391,5 +391,5 @@
 
     /* 10. call handler */
-    	movl r1 = _hardcoded_load_address
+    	movl r1 = kernel_image_start
     
     	mov b1 = loc2
Index: kernel/arch/ia64/src/start.S
===================================================================
--- kernel/arch/ia64/src/start.S	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ kernel/arch/ia64/src/start.S	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -186,20 +186,10 @@
 	movl r20 = (VRN_KERNEL << VRN_SHIFT) ;;
 	or r20 = r20, r1 ;;
-	movl r1 = _hardcoded_load_address
+	movl r1 = kernel_image_start
 	
 	/*
-	 * Initialize hardcoded_* variables. Do only BSP
+	 * Initialize bootinfo on BSP.
 	 */
-(p3)	movl r14 = _hardcoded_ktext_size
-(p3)	movl r15 = _hardcoded_kdata_size
-(p3)	movl r16 = _hardcoded_load_address ;;
-(p3)	addl r17 = @gprel(hardcoded_ktext_size), gp
-(p3)	addl r18 = @gprel(hardcoded_kdata_size), gp
-(p3)	addl r19 = @gprel(hardcoded_load_address), gp
-(p3)	addl r21 = @gprel(bootinfo), gp
-		;;
-(p3)	st8 [r17] = r14
-(p3)	st8 [r18] = r15
-(p3)	st8 [r19] = r16
+(p3)	addl r21 = @gprel(bootinfo), gp ;;
 (p3)	st8 [r21] = r20
 	
Index: kernel/generic/include/main/main.h
===================================================================
--- kernel/generic/include/main/main.h	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ kernel/generic/include/main/main.h	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -38,4 +38,7 @@
 #include <arch/types.h>
 
+extern size_t hardcoded_kdata_size;
+extern size_t hardcoded_ktext_size;
+extern uintptr_t hardcoded_load_address;
 extern uintptr_t stack_safe;
 
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ kernel/generic/src/main/main.c	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -101,16 +101,4 @@
 context_t ctx;
 
-/*
- * These 'hardcoded' variables will be intialized by
- * the linker or the low level assembler code with
- * appropriate sizes and addresses.
- */
-
-/** Virtual address of where the kernel is loaded. */
-uintptr_t hardcoded_load_address = 0;
-/** Size of the kernel code in bytes. */
-size_t hardcoded_ktext_size = 0;
-/** Size of the kernel data in bytes. */
-size_t hardcoded_kdata_size = 0;
 /** Lowest safe stack virtual address. */
 uintptr_t stack_safe = 0;		
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 743e17bf54160e940eea1d5178f24fec565f5b9a)
+++ uspace/srv/vfs/vfs_ops.c	(revision e5d4294414755bb3480a9ea9e93a7fc597b32d05)
@@ -934,5 +934,4 @@
 {
 	int fd = IPC_GET_ARG1(*request);
-	size_t size = IPC_GET_ARG2(*request);
 	ipcarg_t rc;
 
