9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] wanted: ventifs?
@ 2010-03-23  2:02 YAMANASHI Takeshi
  2010-03-23  2:19 ` Rodolfo (kix)
  0 siblings, 1 reply; 6+ messages in thread
From: YAMANASHI Takeshi @ 2010-03-23  2:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi,

I remember that there was a program called "ventifs" at one time in the past
which enabled users  to traverse a venti tree using usual 'cd' and 'ls' commands
but I couldn't find it on the recent /n/sources/plan9 .

Can someone let me know where I can find it?
--
YAMANASHI Takeshi



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] wanted: ventifs?
  2010-03-23  2:02 [9fans] wanted: ventifs? YAMANASHI Takeshi
@ 2010-03-23  2:19 ` Rodolfo (kix)
  2010-03-23  2:48   ` YAMANASHI Takeshi
  0 siblings, 1 reply; 6+ messages in thread
From: Rodolfo (kix) @ 2010-03-23  2:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

vacfs?

saludos.

On Tue, Mar 23, 2010 at 3:02 AM, YAMANASHI Takeshi <9.nashi@gmail.com> wrote:
> Hi,
>
> I remember that there was a program called "ventifs" at one time in the past
> which enabled users  to traverse a venti tree using usual 'cd' and 'ls' commands
> but I couldn't find it on the recent /n/sources/plan9 .
>
> Can someone let me know where I can find it?
> --
> YAMANASHI Takeshi
>
>



-- 
Rodolfo García "kix"
http://www.kix.es/ ham: EA4ERH @ IN80ER



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] wanted: ventifs?
  2010-03-23  2:19 ` Rodolfo (kix)
@ 2010-03-23  2:48   ` YAMANASHI Takeshi
  2010-03-23  7:41     ` Russ Cox
  2010-03-23  8:32     ` [9fans] limited success [was: Install CD hanging on "probing floppy"] EBo
  0 siblings, 2 replies; 6+ messages in thread
From: YAMANASHI Takeshi @ 2010-03-23  2:48 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

ventifs presents you its hash scores as their file names
and you should be able to 'ls' or 'cat' the scores to traverse
the venti tree while vacfs presents you more familiar file names.
-- 

On Tue, Mar 23, 2010 at 11:19 AM, Rodolfo (kix) <kix@kix.es> wrote:
> vacfs?
>
> saludos.
>
> On Tue, Mar 23, 2010 at 3:02 AM, YAMANASHI Takeshi <9.nashi@gmail.com> wrote:
>> Hi,
>>
>> I remember that there was a program called "ventifs" at one time in the past
>> which enabled users  to traverse a venti tree using usual 'cd' and 'ls' commands
>> but I couldn't find it on the recent /n/sources/plan9 .
>>
>> Can someone let me know where I can find it?
>> --
>> YAMANASHI Takeshi
>>
>>
>
>
>
> --
> Rodolfo García "kix"
> http://www.kix.es/ ham: EA4ERH @ IN80ER
>
>

-- 
YAMANASHI Takeshi



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] wanted: ventifs?
  2010-03-23  2:48   ` YAMANASHI Takeshi
@ 2010-03-23  7:41     ` Russ Cox
  2010-03-25  2:39       ` YAMANASHI Takeshi
  2010-03-23  8:32     ` [9fans] limited success [was: Install CD hanging on "probing floppy"] EBo
  1 sibling, 1 reply; 6+ messages in thread
From: Russ Cox @ 2010-03-23  7:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Mon, Mar 22, 2010 at 7:48 PM, YAMANASHI Takeshi <9.nashi@gmail.com> wrote:
> ventifs presents you its hash scores as their file names
> and you should be able to 'ls' or 'cat' the scores to traverse
> the venti tree while vacfs presents you more familiar file names.

i don't remember that.
there was a toy venti browser gui at one point;
it might still be in /sys/src/cmd/venti.

russ


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [9fans] limited success [was: Install CD hanging on "probing floppy"]
  2010-03-23  2:48   ` YAMANASHI Takeshi
  2010-03-23  7:41     ` Russ Cox
@ 2010-03-23  8:32     ` EBo
  1 sibling, 0 replies; 6+ messages in thread
From: EBo @ 2010-03-23  8:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


Well it looks like I *finially* got my Gateway DX4300 to install and
run Plan9 (using 9atom version 3/19/2010).  I've decided to post the
following notes for the poor saps using the DX4300 for just about
anything, because I've read various posts with people having trouble
with these MB's.  Also, I hope that this might be useful as an
overview for those having weird SATA problems installing and running
Plan9.

Overview:

  As Erik Quanstrom pointed out, some of the EIDE/SATA interface
  chips are buggy, and one should not mix/match devices.  The problem
  on my machine is installing plan9 on any SATA hard drive on a
  DX4300 causes weird problems. (Maybe we can sort it out later, for
  for now a mixed IDE/SATA setup works.

  The DX4300 appears to have two SATA controllers.  The first
  controls SATA 1-4, they can be disabled, and have their mode set.
  The second, SATA 5-6, is always on and you have no control over the
  mode, etc.  My first success with plan9 on this machine was
  achieved by unplugging *all* SATA devices and booting off an EIDE
  CDROM and disk.  Once this worked I reconfigured one device at a
  time, reinstalled, tested, etc., until I ended up with what seems
  the most stable configuration.

  An interesting aside, on this MB, if you use SATA5/6, then the
  devices show up as hd*, and if you use SATA1-4 they show up as
  sd*.  This solves some anoying problems on this MB for Linux users
  who find that their drive letters float around alot...


Notes on Interesting Configurations...

=================================

SATA(6) - CDROM
SATA(5) - 1TB Disk
EIDE(M) - 250G Disk (DMA-0 must be set)

EIDE - Enabled
SATA - Enabled
  mode - Native IDE

This appears to be the most stable configuration.  It will boot Plan
9 from the CD, Linux from the SATA HD, and Plan9 from the IDE HD.
Booting plan9 from the SATA HD gives the following errors:

Plan9 on SATA(5):

  PBS2...
Plan 9 From Bell Labs
ELCR: 0C80
pcirouting: South bridge 1002, 439D not found
dev A0 port 1F0 config 427A capabilities 2F00 mwdma 0007 udma 047F    LLBA
sectors 1953525168
dev B0 port 1F0 config 85C0 capabilities 0F00 mwdma 0007 udma 013F
dev A0 port 170 config 427A capabilities 2F00 mwdma 0007 udma 013F    LLBA
sectors 488397168
.
1. 1
2. 1
3. none of the above
*nobiosload:

Booting from the EIDE MBR and using sdC0!9fat!9pcf (which is the SATA
drive, gives the following errors:

ELCR: 0C80
pcirouting: ignoring south bridge PCI.0.20.3 1002/439D
..
ohci interupt: unhandled sts 0x00000040
ohci interupt: unhandled sts 0x00000040

   and here is where it hangs.

In order to get this to work please note that I had to boot Plan 9
with nodma, and actually set the EIDE disk DMA to 0 in the BIOS.  I
have since then added extra SATA drives to 1+2, and they appear to
function properly.

=================================

SATA(6) - CDROM
SATA(5) - 1TB Disk
EIDE(M) - 250G Disk

EIDE - Enabled
SATA - Enabled
  mode - Native IDE and ACHI

This configuration will boot from the CD, Linux from the SATA HD.
Grub and Plan9 cannot see the IDE HD.  Attempting to boot plan9 from
the SATA HD gives the same *nobiosload error as above.

=================================

SATA(6) - CDROM
SATA(5) - 1TB Disk
EIDE(M) - 250G Disk

EIDE - Enabled
SATA - Disable

This configuration will boot from the CD, Linux from the SATA HD,
plan9 from the IDE HD, but plan9 from the SATA HD gives the same:

  ohci interupt: unhandled sts 0x00000040

errors from above.

=================================




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] wanted: ventifs?
  2010-03-23  7:41     ` Russ Cox
@ 2010-03-25  2:39       ` YAMANASHI Takeshi
  0 siblings, 0 replies; 6+ messages in thread
From: YAMANASHI Takeshi @ 2010-03-25  2:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

Hi,

I found ventifs.c on a rather old Plan 9  installation.
It didn't get compiled on the recent Plan 9 at first but I managed to
tweak the old ventifs.c to get compiled on the recent system.
I attached the new ventifs.c to this mail just in the case someone else
get interested.

cpu% ventifs 3fd0720568d5c7f0594646eee2e53346bb494be5
entry: size 120 psize 8160 dsize 8192
cpu% ls -l /n/kremvax
--r--r--r-- M 520 venti venti 8192 Mar 25 07:37
/n/kremvax/27ee01e7b700287ec73b8465268c415854a3feac
--r--r--r-- M 520 venti venti 8192 Mar 25 07:37
/n/kremvax/6eb42b415e85d8d2c20d52a69a7d06d62124dc35
d-r-xr-xr-x M 520 venti venti  240 Mar 25 07:37
/n/kremvax/cb5c3b3441909319f45d5de8ff39da31a249e40b

Warning:
I only skimmed through the source and literally translated some
function names/enum values to just get compiled.
It seems working so far but I'm not sure about what I did to the source at all.


On Tue, Mar 23, 2010 at 4:41 PM, Russ Cox <rsc@swtch.com> wrote:
> On Mon, Mar 22, 2010 at 7:48 PM, YAMANASHI Takeshi <9.nashi@gmail.com> wrote:
>> ventifs presents you its hash scores as their file names
>> and you should be able to 'ls' or 'cat' the scores to traverse
>> the venti tree while vacfs presents you more familiar file names.
>
> i don't remember that.
> there was a toy venti browser gui at one point;
> it might still be in /sys/src/cmd/venti.
>
> russ
>
>



--
YAMANASHI Takeshi

[-- Attachment #2: ventifs.c --]
[-- Type: application/octet-stream, Size: 6075 bytes --]

/*
 * Present venti hash tree as file system for debugging.
 */

#include <u.h>
#include <libc.h>
#include <venti.h>
#include </sys/src/cmd/vac/vac.h>
#include <fcall.h>
#include <thread.h>
#include <9p.h>

VtFile *rootf;

void
responderrstr(Req *r)
{
	char e[ERRMAX];

	rerrstr(e, sizeof e);
	respond(r, e);
}

void
mkqide(Qid *q, VtEntry *e)
{
	if(e->type&VtDirType)
		q->type = QTDIR;
	else
		q->type = 0;
	q->path = *(uvlong*)e->score;
	q->vers = *(ulong*)(e->score+8);
}

void
mkqid(Qid *q, VtFile *f)
{
	VtEntry e;

	vtfilelock(f, VtOREAD);
	vtfilegetentry(f, &e);
	vtfileunlock(f);
	mkqide(q, &e);
}

void
fsdestroyfid(Fid *fid)
{
	if(fid->aux)
		vtfileclose(fid->aux);
}

void
fsattach(Req *r)
{
	r->fid->aux = rootf;
	vtfileincref(rootf);
	mkqid(&r->ofcall.qid, rootf);
	r->fid->qid = r->ofcall.qid;
	respond(r, nil);
}

void
fsopen(Req *r)
{
	if(r->ifcall.mode != OREAD){
		respond(r, "read-only file system");
		return;
	}
	r->ofcall.qid = r->fid->qid;
	respond(r, nil);
}

void
fsreaddir(Req *r)
{
	Dir d;
	int dsize, nn;
	char score[2*VtScoreSize+1];
	uchar edata[VtEntrySize], *p, *ep;
	u32int i, n, epb;
	u64int o;
	VtFile *f;
	VtEntry e;

	memset(&d, 0, sizeof d);
	d.name = "0123456789012345678901234567890123456789";
	d.uid = "venti";
	d.gid = "venti";
	d.muid = "";
	d.atime = time(0);
	d.mtime = time(0);
	d.mode = 0444;
	dsize = sizeD2M(&d);

	p = (uchar*)r->ofcall.data;
	ep = p+r->ifcall.count;
	f = r->fid->aux;
	vtfilelock(f, VtOREAD);
	vtfilegetentry(f, &e);
	epb = e.dsize / VtEntrySize;
	n = vtfilegetdirsize(f);
//fprint(2, "dirsize %d\n", n);
	i = r->ifcall.offset / dsize;
	for(; i<n; i++){
//fprint(2, "%d...", i);
		if(p+dsize > ep)
{
//fprint(2, "done %p %d %p\n", p, dsize, ep);
			break;
}
		o = (i/epb)*e.dsize+(i%epb)*VtEntrySize;
		if(vtfileread(f, edata, VtEntrySize, o) != VtEntrySize){
			vtfileunlock(f);
			responderrstr(r);
			return;
		}
		if(vtentryunpack(&e, edata, 0) < 0){
			fprint(2, "entryunpack: %r\n");
			continue;
		}
		if(!(e.flags&VtEntryActive)){
			strcpy(score, "________________________________________");
			d.qid.type = 0;
		}else{
			snprint(score, sizeof score, "%V", e.score);
			mkqide(&d.qid, &e);
		}
		d.name = score;
		if(e.type&VtDirType){
			d.mode = DMDIR|0555;
			d.qid.type = QTDIR;
		}else{
			d.mode = 0444;
			d.qid.type = 0;
		}
		d.length = e.size;
		nn = convD2M(&d, p, dsize);
		if(nn != dsize)
			fprint(2, "oops: dsize mismatch\n");
		p += dsize;
	}
	r->ofcall.count = p - (uchar*)r->ofcall.data;
	vtfileunlock(f);
	respond(r, nil);
}

void
fsread(Req *r)
{
	long n;

	if(r->fid->qid.type&QTDIR){
		fsreaddir(r);
		return;
	}
	vtfilelock(r->fid->aux, VtOREAD);
	n = vtfileread(r->fid->aux, r->ofcall.data, r->ifcall.count, r->ifcall.offset);
	vtfileunlock(r->fid->aux);
	if(n < 0){
		responderrstr(r);
		return;
	}
	r->ofcall.count = n;
	respond(r, nil);
}

void
fsstat(Req *r)
{
	VtEntry e;

	vtfilelock(r->fid->aux, VtOREAD);
	if(vtfilegetentry(r->fid->aux, &e) < 0){
		vtfileunlock(r->fid->aux);
		responderrstr(r);
		return;
	}
	vtfileunlock(r->fid->aux);
	memset(&r->d, 0, sizeof r->d);
	r->d.name = smprint("%V", e.score);
	r->d.qid = r->fid->qid;
	r->d.mode = 0444;
	if(r->d.qid.type&QTDIR)
		r->d.mode |= DMDIR|0111;
	r->d.uid = estrdup9p("venti");
	r->d.gid = estrdup9p("venti");
	r->d.muid = estrdup9p("");
	r->d.atime = time(0);
	r->d.mtime = time(0);
	r->d.length = e.size;
	respond(r, nil);
}

char*
fswalk1(Fid *fid, char *name, void*)
{
	uchar score[VtScoreSize], edata[VtEntrySize];
	u32int i, n, epb;
	u64int o;
	VtFile *f, *ff;
	VtEntry e;

	if(dec16(score, sizeof score, name, strlen(name)) != VtScoreSize)
		return "file not found";

	f = fid->aux;
	vtfilegetentry(f, &e);
	epb = e.dsize / VtEntrySize;
	n = vtfilegetdirsize(f);
	o = 0;
	for(i=0; i<n; i++){
		o = (i/epb)*e.dsize+(i%epb)*VtEntrySize;
		if(vtfileread(f, edata, VtEntrySize, o) != VtEntrySize)
			return "error in vtfileread";
		if(vtentryunpack(&e, edata, 0) < 0)
			continue;
		if(!(e.flags&VtEntryActive))
			continue;
		if(memcmp(e.score, score, VtScoreSize) == 0)
			break;
	}
	if(i == n)
		return "entry not found";
	ff = vtfileopen(f, i, VtOREAD);
	if(ff == nil)
		return "error in vtfileopen";
	vtfileclose(f);
	fid->aux = ff;
	mkqid(&fid->qid, ff);
	return nil;
}

char*
fsclone(Fid *fid, Fid *newfid, void*)
{
	newfid->aux = fid->aux;
	vtfileincref(fid->aux);
	return nil;
}

void
fswalk(Req *r)
{
	VtFile *f;

	f = r->fid->aux;
	vtfilelock(f, VtOREAD);
	walkandclone(r, fswalk1, fsclone, nil);
	vtfileunlock(f);
}

Srv fs =
{
.destroyfid=	fsdestroyfid,
.attach=		fsattach,
.open=		fsopen,
.read=		fsread,
.stat=		fsstat,
.walk=		fswalk
};

void
usage(void)
{
	fprint(2, "usage: ventifs score\n");
	exits("usage");
}

void
main(int argc, char **argv)
{
	VtConn *z;
	VtCache *c;
	VtBlock *b;
	VtRoot root;
	VtEntry e;
	int bsize;
	uchar score[VtScoreSize];

	bsize = 16384;
	ARGBEGIN{
	case 'D':
		chatty9p++;
		break;
	case 'b':
		bsize = atoi(EARGF(usage()));
		break;
	default:
		usage();
	}ARGEND

	if(argc != 1)
		usage();

	fmtinstall('V', vtscorefmt);

	if((z = vtdial(nil)) == nil)
		sysfatal("vtDial: %r");
	if(vtconnect(z) < 0)
		sysfatal("vtConnect: %r");

	c = vtcachealloc(z, bsize, 50);

	if(vtparsescore(argv[0], nil, score) < 0)
		sysfatal("bad score: %r");
	b = vtcacheglobal(c, score, VtRootType);
	if(b){
		if(vtrootunpack(&root, b->data) < 0)
			sysfatal("bad root: %r");
		memmove(score, root.score, VtScoreSize);
		vtblockput(b);
	}
	b = vtcacheglobal(c, score, VtDirType);
	if(b == nil)
		sysfatal("vtcacheglobal %V: %r", score);
	if(vtentryunpack(&e, b->data, 0) < 0)
		sysfatal("%V: vtentryunpack failed", score);
	fprint(2, "entry: size %llud psize %d dsize %d\n",
		e.size, e.psize, e.dsize);
	vtblockput(b);

	if(!(e.type&VtDirType)){
		b = vtcacheallocblock(c, VtDirType);
		vtentrypack(&e, b->data, 0);
		memmove(e.score, b->score, VtScoreSize);
		e.type |= VtDirType;
		e.size = VtEntrySize;
//		e.depth = 0;
		vtblockput(b);
	}

	rootf = vtfileopenroot(c, &e);
	if(rootf == nil)
		sysfatal("vtFileOpenRoot: %r");

	postmountsrv(&fs, nil, "/n/kremvax", MREPL);
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-03-25  2:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-23  2:02 [9fans] wanted: ventifs? YAMANASHI Takeshi
2010-03-23  2:19 ` Rodolfo (kix)
2010-03-23  2:48   ` YAMANASHI Takeshi
2010-03-23  7:41     ` Russ Cox
2010-03-25  2:39       ` YAMANASHI Takeshi
2010-03-23  8:32     ` [9fans] limited success [was: Install CD hanging on "probing floppy"] EBo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).