int test_memports()
{
	file_t port;
	char *msg="This is long message";
	char buf[64];
	u32_t len=strlen(msg)+1;
	port=ioAllocSection(sizeof(io_section_t),msg,len);
	conPrintf("Size is %u, pos %u.\n",ioportSize(port),ioportTell(port));
	len=ioportRead(port,buf,100);
	conPrintf("Read %u bytes: '%s'.\n",len,buf);
	conPrintf("Size is %u, pos %u.\n",ioportSize(port),ioportTell(port));
	conPrintf("Seek at 5: pos %u.\n",ioportSeek(port,5,SEEK_SET));
	len=ioportRead(port,buf,100);
	conPrintf("Read %u bytes: '%s'.\n",len,buf);
	conPrintf("Seek at -8 from end: pos %u.\n",ioportSeek(port,-8,SEEK_END));
	len=ioportRead(port,buf,100);
	conPrintf("Read %u bytes: '%s'.\n",len,buf);
	ioportSeek(port,13,SEEK_SET);
	ioportSeek(port,-5,SEEK_CUR);
	conPrintf("Seek at 13; offset -5. Pos %u.\n",ioportTell(port));
	len=ioportRead(port,buf,100);
	conPrintf("Read %u bytes: '%s'.\n",len,buf);
	ioportClose(port);	/* this is valid, also warning issued */
	return 0;
}
