Re: [9fans] thoughs about venti+fossil
After this fact the colliding block is itself very interesting, aand it is also very likely that theis block will be stored and archived just for this reason. Which will increase the chance of a failure ;-O by how much? the fact that something *could* happen is often meaningless. what is lim{x-∞} 1+1/x? the εδ argument made to proove the result always says that if i control the input of a function this much i can control the output that much. in the real world there are limits (ha!) to how small or large something can get before it is practically infinite or zero. this is because, .e.g., there is no such thing as 1e24 bytes of storage. theoretically, i don't think a collision by itself would be all that interesting. the number of possible bit patterns in, say, 8k blocks would be 2^(8*8192). while the number of possible bit patterns in a sha1 hashs 2^(8*20). assuming an even distribution, there would be ceil(2^(8*8192)/2^(8*20) - 1) = 2^(8*8172) - 1 collisions on average per hash value. (that's ~1.37e4095, btw.) the only way a collision would be interesting is if it exposed a weakness in sha1. - erik
Re: [9fans] thoughs about venti+fossil
There is a possibility that a meteorite will crush your head any moment, there are some statistics about how probable this, but as you say, they are not reliable, so best go live in a very deep cave, just make sure there is no Internet access, the world will be grateful for it. actually, the world runs on probability. einstein was wrong. god does play dice. quantum mechanical equations are probability equations. the interactions between basic force-carrying particles are probability equations. and the best understanding is that time itself runs in one direction due to probability. pretty cool, eh? - erik
Re: [9fans] thoughs about venti+fossil
But for HA applications, we still need some additional redundancy or at least some error diagnostics at application level. Well, we'll most likely needs this anyways, eg. to detect human fault or code bugs. My current idea is to use two separate hash functions in parallel (as many sw distros already do). But I've got no idea if this really helps or collissions in SHA-1 will often go parallel with colissions in the second hash (eg. MD5). adding a second hash will likely increase your failure rate as the failure rate of storage is collision rate of sha1. and adding a second hash will increase your storage, thus increasing your exposure to storage failure. - erik
Re: [9fans] New user question
Probably for the same reason I do when the occasion arises. It is conveniently a rescue environment too. On Thu, Mar 6, 2008 at 4:53 PM, Pietro Gagliardi [EMAIL PROTECTED] wrote: Why are you running from a live CD? i find it even more convienent to leave a small kfs around and leave a non-default entry in plan9.ini which uses it as root. then, should the need arise, i can just enter the number of the resecue option on boot. looking for a cd is positively no fun when things are not working. - erik
Re: [9fans] Xen and new venti
I can't see why this should have been necessary - libc contains memcpy already. I have just updated /n/sources/xen/xen3 so it compiles with the current Plan 9 kernel source (using Xen 3.0.2). I made the other changes you listed, but I didn't have to do anything about memcpy. the reason it's necessary is that although the kernel links against the c library, it does not include libc.h. this is very much on purpose as not every function in libc is safe for use in the kernel. in this case, the definition for memcpy was likely not picked up in portfns.h so the linker couldn't find the proper function. - erik
Re: [9fans] Xen and new venti
I tryed both compiling the kernel with xen 3.2.0 and xen 3.0.2 include files with the same result I've debugging active on xen so I will paste at the end what happens In any case it's odd that the kernels from /n/sources/xen/xen3 boots smoothly on xen 3.2.0 [without venti of course ] while the others do not. this sounds like the problem seen on real hardware a few months ago. the problem was that the kernel plus the page tables didn't fit in the temporary page tables set up in l.s. it may be that there's another bug in there. the easiest way to check would be to see if there aren't devices you aren't useing and eliminate them from your xencpuf configuration. stripping venti will also make your kernel smaller. to do this, comment out this line in port/mkportall if(~ $t *executable* ! ~ $name venti) if reducing the size of the kernel solves the problem, then i think it's a good bet, the original problem is not completely solved. - erik
Re: [9fans] thoughs about venti+fossil
On Mar 4, 2008, at 8:00 PM, Enrico Weigelt wrote: some thoughts about venti that go around in my mind: 1. how stable is the keying ? sha-1 has only 160 bits, while data blocks may be up to 56k long. so, the mapping is only unique into one direction (not one-to-one). how can we be *really sure*, that - even on very large storages (TB or even PB) - data to each key is alway (one-to-one) unique ? http://www.nmt.edu/~val/review/hash/index.html Not that this analysis is without flaws, though. have you invented the 9fans.net effect? this link may or may not be similar. but it is on point: http://www.valhenson.org/review/hash.pdf do you care to elaborate on the flaws of this analysis? - erik
Re: [9fans] plan9port build failure on Linux (debian)
install.log was no help, the message I quoted was everything relevant. I took a stab at running gdb through yacc, but the compiler optimized the code to the point finding the problem was nearly impossible.best I can say is its somewhere in the dofmt() function (lib9/fmt/dofmt.c) or something it calls. i trust you ran yacc under gdb not gdb through yacc. :-) the problem is unlikely to be with the print. it likely occurred in argument parsing. one thing that should be fixed in p9p is the ARGF() calls should be replaced with EARGF(usage()) in setup(). the definition of usage should be void usage(void) { fprint(2, usage: yacc [-Dn] [-vdS] [-o outputfile] [-s stem] grammar\n); exits(usage); } once that is fixed, it would be interesting to see if yacc prints a usage statement instead of printing the garbage. assuming that things are still broken, i would suggest adding fprint(2, ...) statements in setup to understand where things are going wrong. - erik
Re: [9fans] plan9port build failure on Linux (debian)
For what its worth, I just added the following lines to yacc.c at the top of the file: #include stdio.h #define sprint sprintf The build of plan9port just completed with no errors, the problem is somewhere in sprint(). I'll try and find time tonight to test out the plan9port build to verify it works. Let me know if I can provide any other useful information. I might try tracking down the bug later this week, but not certain I'll have much time to do so. it is very likely that you have broken yacc in a different way by doing this. stdio formats are not compatable with plan 9 print formats. for example, u is a flag when used with sprint but a verb when used with printf. (not to mention the fact that other programs than yacc use sprint.) have you verified that a standalone program with a similar print statement has the same problems? - erik
Re: [9fans] awk, not utf aware...
On the LINUX machines running utf-8 the ä is coded as $C3A4 which is in utf-8 equal to the character E4. The ä occupies in that way 2 bytes. I was very astonished, when I copied a mac-filename, pasted into a texteditor and looked at the file: In the mac-filename the letter ä is coded as: $61CC88, which in utf-8 means the letter a followed by a $0308. (Combining diacritical marks) So the Mac combines the letter a with the two points above it instead using the E4 letter Now the things are clear: The filenames are different, in spite of looking equally. So, if folding codepoints is a reasonable tactic, how many representations do you need to fold? How many binary representations are needed to fold íïìîi - i? i didn't make my point very well. in this case i was suggesting a -f flag for grep that would map a codepoints into their base codepoint. the match result would be the original text --- in the manner of the -i flag. seperately, however ... utf combining characters are a really unfortunate choice, imho. there is no limit to the number of combining codepoints one can add to a base codepoint. you can, for example build a single letter like this U+0061 U+0302 ... U+0302 i don't think it's possible to build legible glyphs from bitmaps using combining diacriticals. therefore, i would argue for reducing letters made up of base+combiners to a precombined codepoint whenever possible. it would be helpful if tcs did this. infortunately some transliterations of russian into the roman alphabet use characters with no precombined form in unicode. rob probablly has a more informed opinion on this than i. - erik
Re: [9fans] GCC/G++: some stress testing
In fact the more I think about it, the more it seems like having a direct way of manipulating L1/L2 caches would be more of a benefit than a curse at this point. Prefetches are nothing but a patchwork over the fundamental need for programming memory hierarchy in an efficient way. But, I guess, there's more to it on the hardware side than just crafting additional opcodes. really? to out-predict the cache hardware, you have to have pretty complete knowlege of everything running on all cores and be pretty good at guessing what will want scheduling next. not to mention, you'd need to keep close tabs on which memory is cachable/wc/etc. maybe system management mode makes too much of an impression on me. but on an intel system, there's on way to prevent the cpu/bios/ipmi from issuing an smm interrupt anytime it pleases and taking over your hardware. my conclusion is we don't have as much control over the hardware as we think we do. decompositions that keep the current working set in cache (at L3, L2, or L1 granularity, depending), while simultaneously avoiding having multiple processors chewing on the same data (which leads to vast amounts of cache synchronization bus traffic). Successful algorithms in this space work on small bundles of data that either get flushed back to memory uncached (to keep more cache for streaming in), or in small bundles that can be passed from compute kernel to compute kernel cheaply. Having language structures to help with these decompositions and caching decisions is a great help - that's one of the reasons why functional programming keeps rearing its head in this space. Without aliasing and global (serializing) state it's much easier to analyze the program and chose how to break up the computation into kernels that can be streamed, pipelined, or otherwise separated to allow better cache utilization and parallelism. aren't these arguments for networked rather than shared memory multiprocessors? - erik
Re: [9fans] Xen and new venti
I'm trying to install plan9 under Xen 3.2.0 with venti but the kernel avaiable on the web is too old to support nventi. perhaps you mean that this kernel has an old venti linked in? I had a problem of type in xendat.h fixed by replacing uint8 with uint at line 1540 i suspect you mean uchar. (or uvlong if they're counting bytes.) mk now gives two errors which I do not know how to fix: ...omissis... size 9xenpcf v4parsecidr: undefined: memcpy in v4parsecidr replace memcpy with memmove. _strayintrx: _ctype: not defined _ctype is used by the is* functions like isascii. - erik
Re: [9fans] GCC/G++: some stress testing
Yes. Although I work for a company that prides itself on its cache coherence know-how, I'm very much a believer in networked multiprocessors, even on a chip. I like Cell better than Opteron, for example. They are harder to program up front, however, which causes difficulties in adoption. Flip-side, once you've overcome your startup hurdles the networked model seems to provide more predictable performance management. tell me about it. a certain (nameless) vendor makes a pcie ethernet chipset with its descriptor rings in system memory, not pci space. it's bizarre watching the performance vs. the number of buffers loaded into the ring between head ptr updates. slight tweeks to the algorithm can result in 35% performance differences. suprisingly, another (also nameless) vendor makes a similar chipset with rings in pci space. this chipset has very stable performance in the face of tuning of the reloading loop. this chip performs just as well as the former though each 32-bit write to the ring buffer results in a round trip over the pcie bus to the card. - erik
Re: [9fans] upas/fs to imap: removed messages sometimes regenerate
I'm seeing some odd (wrong) behavior with Plan 9's upas/fs and was wondering of others have seen it, before I start digging further. I use upas/fs to talk to a local mailbox and two IMAP servers. The local store and one of the IMAP servers work reliably correctly. On the other IMAP server, upas/fs will *sometimes* get into a state where when I remove a message, it'll re-insert itself into the tree with a higher message number. For example, with the IMAP server dalet: :; cd /mail/fs/dalet :; ls 1 2 ctl :; rm 1 2 ; ls 3 4 ctl Messages 34 are the same as 12; nothing new's actually come in. Other IMAP clients I've used behave properly with this server. I've not yet identified the pattern which causes it, but it's not random. Anyone else seen this or similar? i've seen this before. the problem was the client and server had lost uid sync. if you know a situation that always produces the behavior it would be interesting to telnet directly to the server and snoop on the uids. 1 login $user $password 2 select inbox 3 status inbox (messages uidvalidity) 4 uid fetch 1:* uid delete messages the normal way. upas/fs uses uid store %uld +flags (\Deleted) and then expunge 5 uid fetch 1:* uid will list all the available messages. if you list the uids, delete messages in a way that causes a problem, then you can list the uids again and see if upas/fs or the server is at fault. - erik
Re: [9fans] GCC/G++: some stress testing
Almost certainly. And so is C. Programming many-core shared-cache machines in languages with global state and aliasing is just plain wrong, in the same way that programming in assembly instead of C is wrong. Add a highly heterogeneous real-time task mix on top of that, and you're in for a world of poor cache performance and deadlocks, which could be avoided by better choices of implementation language. i don't understand this argument. are you saying that csp doesn't work in c? or are you saying that csp has caching problems that some other languages solve? also, could you define what you mean by shared cache a bit more. would you consider an intel quad core cpu to be a shared cache machine, since the two l2 caches sit on the same fsb? Programming for the memory hierarchy is way more important than optimizing CPU clocks anymore (though that winds up still having a place in some compute kernels). I wish our programming languages reflected that change in perspective. what do you mean by programming for the memory heirarchy? - erik
Re: [9fans] GCC/G++: some stress testing
If GNU was so reliable we wouldn't see the C compiler generate random opcodes for architectures we use at my work. And that's *with* the 4x toolchain. I think we've all had enough software evangelism. Everyone has bugs. GNU is absolutely no exception. they do, with complete reliability, break new things in new releases. - erik
Re: [9fans] Unable to find South Bridge
During boot, I get: pcirouting: South Bridge , not found and later: pcirouting: Cannot find south bridge PCI.255.31.7 Do any of you know what might be going on? Any suggestions as to how I might get Plan 9 going on this hardware? i don't think the problem is your south bridge. very few of them need to be recognized, so they aren't. the problem is likely that you need the vid/did of the ide controller in your motherboard added to the ata driver. if you have a system on which you can compile a kernel, try applying this diff ; diffy -c /sys/src/9/pc/sdata.c /n/dump/2008/0229/sys/src/9/pc/sdata.c:1960,1965 - /sys/src/9/pc/sdata.c:1960,1968 r = pcicfgr8(p, 0x46); pcicfgw8(p, 0x46, (r 0x0C)|0xF0); /*FALLTHROUGH*/ + case (0x740116)|0x1022: /* AMD 755 Cobra */ + case (0x740916)|0x1022: /* AMD 756 Viper */ + case (0x741016)|0x1022: /* AMD 766 Viper Plus */ case (0x746916)|0x1022: /* AMD 3111 */ /* * This can probably be lumped in with the 768 above. if you don't contact me offline and we'll figure something out. - erik
Re: [9fans] problem with compilation of abaco from fgb's sources
hmmm... I'm not getting this, my patch just adds an int color to the ruler item. don't know where did those rectangles came from. older patch? it's not something i added but it is (was) required for abaco at some point. - erik
Re: [9fans] problem with compilation of abaco from fgb's sources
i believe the patch is out-of-date. this is a diff against the current html.h ; 9diff html.h /n/sources/plan9//sys/include/html.h:173,178 - html.h:173,179 Item* next; /* successor in list of items */ int width; /* width in pixels (0 for floating items) */ int height; /* height in pixels */ + Rectangle r; int ascent; /* ascent (from top to baseline) in pixels */ int anchorid; /* if nonzero, which anchor we're in */ int state; /* flags and values (see below) */ /n/sources/plan9//sys/include/html.h:350,355 - html.h:351,357 Item* image; /* image item, for Fimage fields */ int ctlid; /* identifies control for this field in layout */ SEvent* events; /* same as genattr-events of containing item */ + void* aux; }; enum { /n/sources/plan9//sys/include/html.h:464,469 - html.h:466,472 int row;/* row of upper left corner */ int col;/* col of upper left corner */ Point pos;/* nw corner of cell contents, in cell */ + Rectangle r; }; /* Anchor is for info about hyperlinks that go somewhere */ - erik
Re: [9fans] ^ and $ in structural expressions
i'm not arguing for or against the idea here, just want to point out that i don't think syntax is the limiting factor. if « and » are not acceptable, then we can reuse existing characters. having ^ and $ loose their idempotency would not be a large inconvience. ^^ and $$ could easily do. adding an expression anchor should not be a major complication. - erik
Re: [9fans] awk, not utf aware...
i had to dig this off 9fans.net/archive. htmlfmt does some very bad things with non-ascii characters. i hope i put them back correctly. Yes, and then there is locale: does [a-z] include ij when you run it in Holland (it should)? Does it include á, è, ô in France (it should)? Does it include ø, å in Norway (it should not)? And what happens when you evaluate è o (it depends)? Fixing awk is much harder than anyone things. I had a chat about it with Brian Kernighan and he says he's been thinking about fixing awk for a long time, but that it really is a hard problem. how does a program know where it's being run? ☺ how do you write a program that processes byte streams from a dutch user and from a norwegian? how does one deal with a multi-language file. i see some problems with localized regexps. like pre-utf character sets, it's impossible to tell from a byte stream what the character set is. two users can run the same program and get different results. (how do you test in an environment like this?) and, of course, you can't switch locale within a file making multi-language files difficult. perhaps it would be more effective to break down the concept a bit. instead of a general locale hammer, why not expose some operations that could go into a locale? for example, have a base- character folding switch that allows regexps to fold codpoints into base codepoints so that íïìîi - i. this information is in the unicode tables. perhaps the language-dependent character mapping should be specified explictly. c. - erik
Re: [9fans] Mouse advice for Acme
I ordered an extra 5 a couple of years ago when work got me a system through them; it's almost time to order 5 more. do the cats get them? my rabbit got two last month. it's those t-t-teeth. - erik
Re: [9fans] awk, not utf aware...
I thought it was obvious that the output was from a 'standard' Plan 9 terminal. But given the percentage of people actually using plan9 in this list, I guess I should have been much more explicit. And the problem is precisely that the environment under which awk run commands is completely different from the one awk is run in; in other words, awk spreads its 'simian' (ape-ish) nature. i think that awk is in a no-win situation here. if it used rc, then awk scripts from plan 9 would break on unix and vice versa. sam and acme have similar issues in p9p's environment. i don't see how either using the native shell or using the shell from the original environment is wrong a priori. awk picks a lane and sticks too it. i'd bet that benefits other ape stuff like lp. if you really don't like this situation, perhaps the solution is to improve upon awk. a plan 9 scripting language based on sre's --- as suggested by rob --- could be really cool. - erik
Re: [9fans] awk, not utf aware...
There is split and other functions, for example: toupper(aí) gives Aí My guess is that there are many more little (or not) corners where it doesn't work. We can go on and on looking for crevices and hiding the bugs further under the rug so that they are not evident and find everyone completely unaware, leave awk as it is now or really fix the problem. The first approach doesn't work. I am going to take the second till I have time to take the third which means use runes or at least revise all the code so that it is uniformly aware of the existance of non-ascii characters. i don't understand this approach. you propose redoing a fundamental part of awk. yet at the end you won't have solved the bug that's bothering you. ignoring the fact that awk is an ape program and doesn't use runes, the problem with toupper is independent of the internal representation of strings. as far as i can tell, ape doesn't even have towupper and towlower. so if you provide those functions, fixing toupper and tolower could be a 5 minute fix. and you know you won't have broken anything else. /sys/doc/utf.ps is worth a read. it's not to hard to think of situations that depend on character boundaries or operate on non-ascii characters. generally there are few. for example, rc only bothers with character boundaries in matching. perhaps you could build a utf testsuite for awk. make sure to use non-latin1 languages, too. - erik
Re: [9fans] GSOC 2008
like a dog? - erik key word - Fixed On Wed, Feb 27, 2008 at 4:24 PM, ron minnich [EMAIL PROTECTED] wrote: On Wed, Feb 27, 2008 at 2:10 PM, Eric Van Hensbergen [EMAIL PROTECTED] wrote: we were talking about Gorka. I added at least 20 years to his age when I fixed his Mac. ron
Re: [9fans] awk, not utf aware...
I think this has come up before, but I didn't found reply. If I do in awk something like: split($0, c, ); c should be an array of Runes internally, UTF externally, but apparently, it is not. Is it just broken?, is there a replacement?, is it just the builtins or is the whole awk broken?. i think the comments about this problem are missing the point a bit. utf8 should be transparent to awk unless the situation demands that awk needs to know the length of a character. it's not necessary to keep strings as Rune*s internally to work with utf8. splitting on is a special case where awk does need to know the length of a character. e.g. this script should work fine ; cat /tmp/smile #!/bin/awk -f { n = split($0, c, ☺); for(i = 1; i = n; i++) print c[i] } ; echo fu☺bar|/tmp/smile fu bar but splitting on won't. i attached a patch that fixes this problem as an illustration. i'm not using utflen because pcc won't see it. it's an ugly patch. i don't think i know what a proper fix for awk would be. i wouldn't think there are many cases like this, but i haven't spent much time with awk internals. - erik -- 9diff run.c /n/sources/plan9//sys/src/cmd/awk/run.c:1191,1196 - run.c:1191,1219 return(False); } + static int + utf8len(char *s) + { + int c, n, i; + + c = *(unsigned char*)s++; + if ((c0xe0) == 0xc0) + n = 2; + else if ((c0xf0) == 0xe0) + n = 3; + else if ((c0xf8) == 0xf0) + n = 4; + else + return 1; //-1; + i = n-1; + if(strlen(s) i) + return 1; // -1; + for(; i-- (c = *(unsigned char*)s++);) + if(0x80 != (c0xc0)) + return 1; //-1; + return n; + } + Cell *split(Node **a, int nnn)/* split(a[0], a[1], a[2]); a[3] is type */ { Cell *x = 0, *y, *ap; /n/sources/plan9//sys/src/cmd/awk/run.c:1279,1290 - run.c:1302,1316 s++; } } else if (sep == 0) { /* new: split(s, a, ) = 1 char/elem */ - for (n = 0; *s != 0; s++) { - char buf[2]; + int i, len; + char buf[5]; + for (n = 0; *s != 0; s += len) { n++; sprintf(num, %d, n); - buf[0] = *s; - buf[1] = 0; + len = utf8len(s); + for(i = 0; i len; i++) + buf[i] = s[i]; + buf[len] = 0; if (isdigit(buf[0])) setsymtab(num, buf, atof(buf), STR|NUM, (Array *) ap-sval); else
Re: [9fans] awk, not utf aware...
And it's wonderful that the C standard defines a character literal as so: char-literal: ' characters ' characters: character characters character (or something like that) Question, then: why do we need wchar_t/Rune? because we have more tha 255 characters. - erik
Re: [9fans] awk, not utf aware...
thanks for catching that. my brain's not on today. generally i avoid the mb functions because they rely on locale. of course this doesn't apply on plan 9 and so there's no reason for utf8len. it looks like mblen is used elsewhere; perhaps this would now be a worthwhile patch. - erik Plan 9 awk is an APE program, so it uses the unpronounceable ANSI mbtowc/wctomb functions to deal with UTF. Thus it uses mblen rather than utflen or utf8len.
Re: [9fans] Soekris 5501s (was kenfs)
On Tue Feb 26 17:30:47 EST 2008, [EMAIL PROTECTED] wrote: http://www.pcengines.ch/alix1c.htm Have you got a plan9 compatible SATA card to work inb the pci slot? This could replace my noisy and power hungry home server. this card is pci-x, but does work in pci slots: http://www.newegg.com/Product/Product.aspx?Item=N82E16815121009 - erik
Re: [9fans] Plan 9 on Fit-PC
I also tried to netboot from my existing cpu/auth/file server. The netboot ROM on the ethernet downloads the kernel but couldn't seem to find a spot in memory to put it[1], so I grabbed gPXE 0.9.3 from http://www.etherboot.org/ and built an ISO. The last thing I see there is Booting from /386/9pc... and then the machine reboots. I'm not sure if this is even getting the whole kernel... last line in /sys/log/ipboot is: that went by a bit fast for me. do you mean that you are pxe loading 9pxeload but the bios pxeloader can't find a place for 9pxeload in memory? or that 9pxeload loaded but couldn't load the kernel? the plan 9 kernel can't be pxe loaded directly. it's too big l.s doesn't handle real mode. - erik
Re: [9fans] Plan9 on Intel Pentiul D Dualcore (D94RPLrn)
if i'm reading the output you've sent correctly, linux is getting the interrupt mappings from ACPI not the MP table. and your mp table is broken. i don't know very much about linux irq handling or acpi irq tables, but it's likely that your mb manufacturer didn't think a full mp table was worth his time. so, i guess this is the menu of options in increasing amount of effort and accomplishment: 1. *nomp=1 2. bios update. 3. figure out what the mp table should be from the acpi tables and forge an mp table for archmp's benefit. 4. teach plan 9 to parse the acpi irq tables. cheer up! the acpi documentation is less than two feet thick. - erik
Re: [9fans] Soekris 5501s (was kenfs)
i have a quick question: any guess on whether lan1641 will work? i think it should wok since it has National Semiconductor DP83816 chip but just wanted to confirm. i have a 4801 with a 3 dp83816 chips and it works fine. - erik
Re: [9fans] kenfs
couple of questions related to this posting as well as your previous one on soekris box: - will this work for 5501 as well? - did u get as many as 8 ethernet ports working? i am thinking of getting 5501 and trying plan9/inferno. i don't know. i don't have a 5501. by the way i should have made it clear that plan 9 does run on this box as ken fs running does not imply that plan 9 does. i wish plan9/inferno community provides more support for soekris products. earlier, i used to wonder why ron minnich didnt go for soekris boards for his projects. plan 9 has run on the 4501 for quite some time. - erik
Re: [9fans] Intel ICH7 AHCI
i feel your pain. i have a new motherboard with some bad entries in the mp table, too. Not surprising. What we see, all the time, is that the mobo makers just barely understand these tables, and usually get them quite wrong. We've also seen cases where the MP table for one board was used, verbatim, on a very different board. Finally, the vendors are always willing to rewire bits of the board, but don't quite get around to updating the table. Short form: PC hardware is crap. i'm not casting aspersions. i've had good luck with getting corrected bios in the few times i've had trouble on server motherboards. i think the problem is that mp interrupts are hard and need to be constructed at bios runtime to account for the topology of add in cards and bridges. - erik
Re: [9fans] Soekris 5501s (was kenfs)
thanks for the information, geoff. do you happen to know if the sata and pata ports are independent? another point of data, the 4801 also works with plan 9, given a bios != 1.20. - erik
Re: [9fans] Intel ICH7 AHCI
assuming my code isn't totally broken on your machine, it looks as if you have no mp table at all. so either your machine has no mp table or we are looking in the wrong place. since i'm a little unsure how this could be, my next step would be to boot linux with mp interrupts to troll dmesg for clues and compare with where we're looking. perhaps someone else has a better idea. in looking at the mp spec 1.4 again http://download.intel.com/design/archives/processors/pro/docs/24201606.pdf plan 9 seems to cover the cases on p. 38 in pc/archmp.c:/^mpsearch. i wonder if that else shouldn't be elided. another way for bios to go wrong here is to report the wrong amount of base memory. - erik
Re: [9fans] plan9 httpd/pegasus on unix?
So my question is what is my best option? Setting up inferno on FreeBSD and run httpd from there? Setting up plan9 in xen (or lguest) and set httpd inside that? Try to port plan9's httpd to unix, using p9p as an example? Just stick to some unix httpd because it's not worth it? (I guess it wouldn't be that hard to get thttpd to run some rc cgis actually). Please bear in my mind that this is an old box (p200, 256MB ram), so the solution has to be light (for example I'm not even sure it's possible to achieve the xen or inferno one). Well, I guess it can't be worse than apache2, which actually used to run on that machine... one little point: rc doesn't run on inferno. - erik
Re: [9fans] Intel ICH7 AHCI
Have tried Plan9 on Intel D945PLrn mainboard P4 Dualcore and MP, Network and AHCI doesnt work out of the box. ok, i try to resolve AHCI first... the pci ids are 0x8086/0x27c0 for the SATA controller (82801GB) and i tried to add this to the match function as Tich in sdiahci.c, but this fails on: if (p-mem[Abar].bar == 0) continue; there's a reason for this check. :-) if bios isn't setting up Abar, then either you're chipset doesn't support ahci or it isn't configured for ahci. generally the options are Enhanced mode with Ahci enabled. they're different for esb southbridges. intel says that the 82801gb does not support ahci mode. http://www.intel.com/support/chipsets/imsm/sb/CS-020644.htm ich7 should support your drives in *ata* mode. you may need to add the vid/did to sdata.c you can double check with pci. the device class/programming interface/subclass should be 01.06.01. you can check for a device with the proper configuration with this command: % pci|grep 'disk 01\.06\.01' This machine also fails MP. I get mpintrenable() errors for any devices including the keyboard and then i end up on the boot prompt unable to type anything. mpintrenable: out of choices -1 -1 generally this means that your machine's mp table is broken. you can add *nomp=1 to your plan9.ini file to get around this. unfortunately, using mp interrupts there's no easy way to replicate what this bios does in setting up the interrupt routing on a modern machine. - erik
Re: [9fans] Intel ICH7 AHCI
This machine also fails MP. I get mpintrenable() errors for any devices including the keyboard and then i end up on the boot prompt unable to type anything. mpintrenable: out of choices -1 -1 generally this means that your machine's mp table is broken. you can add *nomp=1 yep, that works then it's highly likely that your mp table is incorrect. in bios there is often an option for mp specification version or some such. you want to set that to 1.4 if you have it. unfortunately, i suspect this is not your problem. i put a version of mp.c on sources (/n/sources/contrib/quanstro/mp.c) that provides the file #P/mpirq which prints out the mp table irq assignments. if you can figure out how to save this stuff automatically with mp irqs enabled, this should have enough information to say for sure. i feel your pain. i have a new motherboard with some bad entries in the mp table, too. - erik
[9fans] kenfs
i put a new version of the kenfs code we're running at coraid on sources. /n/sources/contrib/quanstro/src/myfs. we continue to see good performance and the most serious problem encountered so far is that the default route was configured incorrectly requiring a creative dynamic route for sntp. this version fixes a locking problem in send and recv when called spllo and a few bugs with odd configurations. it also deprecates devsd code. the huge size of the myricom firmware lead to devices and ethernet controllers. these are controlled by tables in $conf/etherctlr.c and $conf/devtab.c. this has reduced the size of the kernel built for the soekris 4501 (aska) to 177994 bytes compressed. finally, the partition code has been reworked so that fdisk or prep partitions may be used in addition to old-style partitions. this allowed the boot code to use a Device instead of a one-off construct for the nvr file. thus the nvr file for aska is nvr=ph09fat!fs.nvr where ph09fat is a regular Device and fs.nvr is a fat file name. the same syntax may be used in filsys declarations. the main filesystem on my new (unfinished) fs is declared as filsys main cpe2.0kcachee2.1 since i need just a few gb of cache, using an fdisk partition allows me to archive linux junk to the rest of that partition without opening an lba accountancy. for performance reasons, it would make less sense for the cache and worm to share a partitioned target. the floppy as been temporarly (?) broken by this change. if anyone is interested in a soekris 4501 fs, contact me off list. judging by the size of my worm, a 4GB CF should be enough to run for several years. or, use a small boot CF and an aoe target. - erik
Re: [9fans] How to move to rc from sh/bash
getflags brings rc scripts in line with the argument parsing rules from the standard plan 9 c maros ARGBEGIN{}ARGEND. - erik I call that a disadvantage, to me it looks like y is an argument to -x If that's what getflags does, then I hope someone runs rm on it This is not LINUX! This is Plan 9. There are rules. The only advantage to getflags is that we can say rcsrcipt -xy instead of rcscript -x -y
Re: [9fans] Improving programs like doc2txt
as tempting as the thought is, c structures != memory layout. - erik Yes, however try reading the C struct for FIB. It's confusing. What is FC? I expected a pure struct definition, like in Appendix A of the PowerPoint specification. On Feb 20, 2008, at 9:55 AM, maht wrote: Never mind. Don't try to convert a Microsoft specification to C! That's odd because the binary formats are basically C structs in an FAT32 file system with some headers. http://www.joelonsoftware.com/items/2008/02/19.html Next time announce it when you've got it going :)
Re: [9fans] Non-stack-based calling conventions
COFF has had to cope with a certain monster dubbed portability; to adapt to the peculiarities of the many flavors of UNIX (and at least one Microsoft OS, with MS-COFF). So good it has been practically put out of business by ELF or... do Plan 9 compilers output COFF object files? see a.out(6). COFF has had to cope with a certain monster dubbed portability; to adapt to the peculiarities of the many flavors of UNIX (and at least one Microsoft OS, with MS-COFF). So good it has been practically put out of business by ELF or... do Plan 9 compilers output COFF object files? flat memory model: http://en.wikipedia.org/wiki/CDC_6600#Memory_organization I am actually very grateful for having a flat 32/64 bit address space all to myself. Even though the curse of managing virtual memory and driving the associated hardware has been placed on every OS developer, occasional programmers like me really enjoy the outcome. it's interesting to note that it is being loaded at a constant address makes the job of loading generating the code much simplier. the location of allocated memory isn't as important --- those details can often be hidden in an malloc-style function. even on 386 hardware, segments can be used to cover all of memory. as long as your allocator knows where not to step (pci space, for example), this should be good enough. so if you're running without the operating system or your application is the operating system (embedded systems), virtual memory might just get in the way. tlb hardware doesn't do its translation for free. - erik
Re: [9fans] Non-stack-based calling conventions
so if you're running without the operating system or your application is the operating system (embedded systems), virtual memory might just get in the way. tlb hardware doesn't do its translation for free. Or if you have moved onto the greener pastures of Limbo... not having to worry about all this saves many headaches when you want to port Inferno to a new arch too. uriel the world isn't this simple. just cause you've got the limbo hammer, doesn't mean all the world's a nail. porting limbo to a new architecture requires porting ken's toolchain and the inferno kernel. i don't see how a self-containted operating system/ application would be less work to port. if the work you're doing is performance-sensitive enough that tlb misses make a difference, then you certainly do not want to pay the penalty of a virtual machine. further, if the work you're doing is in the kernel or kernel-level, unless you have hardware implemting dis, you can't write this in a language like limbo which targets a virtual machine. - erik
Re: [9fans] Non-stack-based calling conventions
how did this get past my erik filter? wrong, wrong, wrong, wrong. four out of four as expected. brucee 100% whinage. 0 justification. 0 information. par for the course. ☺ since you disagree, i assume you claim that limbo's the hammer and all computing problems are nails. i'd like to know why limbo's the right thing to run, e.g., on a freescale hc08 microcontroller. i'd also like to know why there is no performance penalty for running dis code over c. do you claim the garbage collection doesn't take any appreciable time? and the there is no overhead dealing with limbo's runtime typechecking? the inferno kernel i know about is written in c. where's the limbo version? how does one run a limbo program on a new architecture without porting the runtime or jit? - erik
[9fans] all the ld.com that fits
you might want to try this one: ; ls -l /n/sourcesdump/2002/1212/plan9/386/ld.com --rwxrwxr-x M 225 glenda sys 64488 Sep 16 2002 ld.com - erik
Re: [9fans] Google search of the day
believe it or not plan 9 does exactly the same thing, as was discussed in august under the subject plan 9 overcommits memory?. fundamentally, i think the stack problem is an operating system problem not a language problem. (unless you're talking about 8 or 16-bit embedded things.) the thread library, for example does just fine requiring its threads to declare a stack size. in the case of a memory-constrained app on an embedded system, the solution might be to find/write an algorithm that doesn't need a stack. :-) - erik (1) Linux had/has a feature where the storage reserved by malloc/sbrk may be over-committed, so that despite a success indication from the allocation, when the application gets around to using the storage it could suddenly fail due to there not being enough to satisfay all current processes. I urged (but don't know whether anybody listened) that overcommitment should be disabled by default, with processes that want it (said to include sparse array programs, which sounds like bad design but that's another issue) being required to enable it by a specific request, or at least flagged as special in the executable object file. I kludged around this in my portable malloc implementation by having a configuration flag which if set caused malloc to attempt to touch every page before reporting success, trapping SIGSEGV in order to maintain control. (2) C, as well as many other PLs, has always had a problem in that there is no clean, standard mechanism to handle the situation in which a function invocation finds insufficient stack remaining to complete the linkage (instance allocation). This is especially problematic in memory-constrained apps such as many embedded systems, when the algorithm is sufficiently dynamic that it is impossible to predict the maximum nesting depth. At least with malloc failure, the program is informed when there is a problem and can take measures to cope with it. I hope people working on run-time environments will find ways to do better.
Re: [9fans] Google search of the day
My understanding has always been that the stack is a fundamental element of the x86 architecture. SP and BP registers, later ESP and EBP, are all about the stack. All return addresses are stored on the stack. Parameter passing relies on it. And I know of no other means of implementing them. Except by avoiding call/ret instructions and solely jmp'ing around in a true mess of a code. No true procedures. while this is true, you are confusing calling convention and architecture. the arch puts some limits on calling convention, but there is no requirement to use the stack if you have one. you could have a calling convention that every function emits a call block with the arguments at callblock+offset and the return value(s) at callblock- offset. doesn't matter if the arch has a stack or not. you are free to ignore it. ' I am almost sure the modern incarnations of FORTRAN (90, or even 77?) do support both true procedures and recursion. Though, I have not tried them so I do not have a say there. fortran 95 supports recursion. this does not imply that the *language* requires a stack. it could be done via heap allocation. i don't know enough fortran to comment intelligently on how its done. Automatic/scoped variables are allocated on the stack frame for procedure calls and/or nested code blocks (Flat Assembler's rendition of the IA-32 enter instruction supports up to 32 stack frames). And without them, programming would be a lot harder. some languages -- notibly c -- assume a stack frame. there are many languages, like fortran that do not. you wouldn't notice what the compiler is doing in those languages. There is also the growing heap for implementing dynamic variables which is quite as problematic as the stack because it, too, can grow beyond bounds and give one headaches. this is an entirely different problem as heap allocations in most languages are *explicit* thus allowing the programmer to respond to the situation appropriately. iirc, v7 sort used a binary search algorithm to figure out how much memory it could sbrk(). e.g. int memsize; for(memsize = 1024*1024; memsize = 4*1024;) if(sbrk(memsize)0) break; - erik
Re: [9fans] /net panic
works for me. I don't know the internal workings of the plan 9 ip stack so I take the risk of being silly: could be that the bug is not tcp only? iru no. the problem is that active tcp timers are overwritten. all the tcp timer code is contained within ip/tcp.c - erik
Re: [9fans] Consindering eBox-4854 for Plan9
vesa mode works. unichrome II is propritary and you can't get the programming docs without an nda. That's changing. Native linuxbios mode support is coming. So the information will exist outside NDA. ron actually programming documentation or just code? - erik
Re: [9fans] Consindering eBox-4854 for Plan9
Maybe all the 9fans moved here? http://www.imdb.com/title/tt0418737/ In any event, you forgot: what order of infinity is the work vs. your free time anyway? You might just be slacking. Enquiring minds want to know! the work items are not hard, there are just countablly many of them. since one works at a basically fixed rate, time to complete the countablly many items is countable. ... oh, wait ... sorry. what i mean is hell ya, i'm totally slacking. i haven't finished a driver in *days*. - erik
Re: [9fans] Consindering eBox-4854 for Plan9
actually programming documentation or just code? just code, but, while I realize code alone is often useless, I am willing to bet the docs in this case are less useful than code. The code will have all the huge doc gaps filled in. ☺. it seems to be a truism among hardware folks. the worse the documentation is, the more tightly it is kept. the via parts do a very good job with vesa. i find our 800mhz terminals very usable. the graphics are pretty snappy. i think it would be more of a priority to tackle the amd(ati) and intel parts for which there is actual documentation. intel documentation is not that great, but, you can learn to live with it. fortunately adding one more thing to the list of things to do will not decrease the amount of my infinite spare time. - erik
[9fans] s3
glad i'm not depending on it: http://www.news.com/8301-10784_3-9873068-7.html?tag=nefd.top - erik
Re: [9fans] ATAPI document
Once, long ago, I found a copy of the ATAPI spec that did not require me sending $$$ to T13. Anybody seen that lately or have a link? ron i remember the draft t13 standards being free on the t13 website. - erik
Re: [9fans] usbd problem
Sorry, I have no ohci hardware so I don't think I can help. Did the uhci machine recognise your devices before the recent update to add ohci support? just got the machine monday. i don't think i have any older kernels with usb compiled in, but i'll see what i can find. i'd like to rule out bios problem, first. - erik
Re: [9fans] usbd problem
Are you killing the old usbd before starting a new one? yes. And is this uhci or ohci? ohci. oddly, my uhci ich9r machine doesn't recognize either of my extensive collection of two usb devices. - erik
Re: [9fans] usbd problem
ohci. oddly, my uhci ich9r machine doesn't recognize either of my extensive collection of two usb devices. You may be running the usbd with faulty dump.c. If your devices show up in /dev/usb0/1/status with just one line and 0x00 for Class/Subclass/Proto, then you're almost certainly running the old dump.c. In dump.c, five lines before the bottom of the file, change len = b[0] - 1 into len = b[0] A new version should already have been posted. Sape unfortunately, that's not the problem. - erik
[9fans] quote of the day
from the linux kernel: bootsplash: silent mode. - erik
Re: [9fans] Google search of the day
On Wed Feb 13 18:32:19 EST 2008, [EMAIL PROTECTED] wrote: In most /bin/sh variants (I'm not sure about original): :(){:|:};: Quick denial of service. iirc, there were not functions in the orginal. - erik
Re: [9fans] usbd problem
thanks for the update. i have switched to a slightly more agreeable key but i have a new way to fail. the key works the first time. but the second time i connect the same key, i get ; usbfat: setupreq: write err: No response usb/disk: describedevice: error writing usb device request: get device descriptor: No response No response mount: mount /n/usb: unknown format initially in this state, i could restart usbd and got this information. ; usb/usbd -fvD usbd: probing usb2/0.1 usbd: probing usb3/0.1 usbd: probing usb4/0.1 usbd: probing usb0/0.1 out 5 [8] 80 06 00 01 00 00 08 00 in 5 [8] 12 01 00 02 00 00 00 40 usb1/0.1 maxpkt: 64 out 5 [8] 00 05 02 00 00 00 00 00 describedevice out 24 [8] 80 06 00 01 00 00 18 00 in 24 [18] 12 01 00 02 00 00 00 40 ec 08 08 00 00 01 01 02 03 01 loadconfig out 24 [8] 80 06 00 02 00 00 ff 03 in 24 [32] 09 02 20 00 01 01 00 80 64 09 04 00 00 02 08 06 50 00 07 05 81 02 40 00 00 07 05 02 02 40 00 00 out 24 [8] 00 09 01 00 00 00 00 00 checking usb1/0.1 ... but two devices (1 and 2) with the identical status files existed. i've got things pretty wedged now -- usbd won't start so it's hard to get much more information. but i did get two done started, 1 0 messages on the console. sorry for the poor bug report. - erik
Re: [9fans] usbd problem
Do you mean why doesn't the ctl file accept partition commands? You can always use fs(3) for that. But usb root is not very practical anyway, at least with uhci, because of a stubborn bug in the driver which makes transfers very very slow. Now there's ohci support I would be interested to know if that works at more like normal usb speed. you're assuming that i want to continue to do i/o once i've booted. :-) the basic problem is that, e.g., ich9r boards have no pata at all. it used to be easy to boot from CF or a DOM. but that's becoming more of a problem. booting from usb might be the only cheep solid-state choice. geoff pointed out that usb/disk pulls in a lot of stuff and might need some work to run in the kernel. so perhaps i don't fully appreciate how interconnected /dev/usb?, usb/usbd, and usb/disk. i was under the impression that usb/disk was just a bit of glue that turns an endpoint into a block device. - erik
Re: [9fans] usbd problem
Nemo found a bug in usb/lib/dump.c that may well account for this. I incorporated his change (and fixed a bug in his code :-). I'll ask Geoff to push it out today. Sape excellent. i'll give it a shot. - erik
Re: [9fans] Re: Booting problem after fresh install from 20080203 iso.
I believe my writing turns out a bit unclear. What I meant to say was that I actually did a dd -if /dev/zero -f /dev/sdC1/raw before I figured out that it should have been dd -if /dev/zero -of /dev/sdC1/data instead. Hence I was wondering if writing those zeroes to the raw file could be the source of my problem (in case those zeroes translate to a command I really shouldn't have given), because this is one of the things I did right before the problem appeared. Anyway, thanks for the reference, I'll take a look at scuzz(8). p. 361 ata 6.1 notes that command 0 is NOP. ata nop does put the drive into an error state so it could have screwed things up into you reboot. it shouldn't, but you'd have to trace through the code to prove it doesn't. - erik
Re: [9fans] usbd problem
Looking at /sys/src/cmd/usb/usbd/usbd.c, I wonder whether your problem has something to do with these lines? //unconscionable kludge (testing camera) if(d-class == 10) setup0(d, RH2D|Rinterface, SET_INTERFACE, 10, 0, 0); thanks for the suggestion, but the camera was a red herring. it was actually the usb key that i'd plugged in. the key works fine with xp. so i engineered a swap of usb keys. it was dying in setup0 with Estalled. shouldn't usbd be resistant to badly-behaving devices? it seems that any error on any endpoint will topple usbd, at least during configure. one final question, is there an advantage to usb/disk creating a fs that's incompatable with devsd? it would seem to make booting from usb root difficult. - erik
Re: [9fans] Re: Booting problem after fresh install from 20080203 iso.
1. I zeroed the target harddisk before installation like this: dd -if /dev/zero -of /dev/sdC1/data. 2. I also accidentally did this first when I really meant to zero the disk: dd -if /dev/zero -f /dev/sdC1/raw. you did the right thing. the raw file is for issuing raw commands to the drive. (not raw like you're thinking. they're raw scsi commands which might be translated (loosely) into ata.) see scuzz(8). - erik
Re: [9fans] s3venti
You could reduce your storage bill by using file names to store the data through information hiding rather than the content ;) http://www.geocities.com/patchnpuki/other/compression.htm One of these days .. my reading of the sla seemed to indicate they count bucket names against you. - erik
Re: [9fans] Hello Assembly
I've always thought variables and such went at the bottom... or is that just m68k asm? John you can put them anywhere. there's no typechecking in assembly and the linker doesn't care. - erik
[9fans] usbd problem
usbd is exiting when i have a camera which is off attached: ; usb/usbd -v ; echo $status usbd 1827: usbd: setup0: usb0/1: transaction error - erik
Re: [9fans] How to move to rc from sh/bash
Well, that isn't so much about rc's advantages. Keep in mind though that this would force getflags to be present whenever you need a shell script. For most installations this isn't an issue, but for those running Plan 9 embedded it is. And with space constraints providing some of /rc/bin might be reasonable, providing aux/getflags might not. i don't buy this argument. if you're running plan 9 with rc scripts, you have many MB of ram and mmu and several MB of persistant storage. it's hard to get small flash parts these days. i can't see 64k mattering. Besides, if a script doesn't use more than two or three different options getflags doesn't reduce much complexity (if you aren't writing a new script). And concerning speed, if command line parsing dominates the execution time I honestly wouldn't bother. i would think that the reason to do this would be for consistency. i don't know that that's a compelling argument. but i can see the attraction of all or nothing; it would be nice if either none of the scripts used getflags or all of them did. - erik
Re: [9fans] s3venti
I mentioned in passing some time ago that I was working on a venti server that uses Amazon S3 as a storage backend. There is now code in /n/sources/contrib/rcbilson/s3venti . Beware sharp edges. I have pumped a fair amount of test data through it successfully, but I wouldn't recommend trusting anything important to it yet. There is a man page. I started writing it under plan9, but for irrelevant reasons later switched to plan9port, so that's where it's known to work (on Linux, at least). I would hope and expect that moving it back to native plan9 would be a small job. Questions and comments are welcome. neat stuff. i took a quick look at pricing -- $0.15/gb/month plus $0.10/gb to transfer data in. assuming it's the data motel and it never checks out, 500GB would cost $1500 to store for a year. but 1GB would cost just $3. this seems nice -- my fs has only 2.5GB of stuff. and even at my cost of $100 for the recycled machine, that $1.60/gb/month. but i would need to cache all that locally have a duplicate copy. so what usage senerio do you have in mind for venti/s3? skip: what are the principles of operation of s3fs? what's the advantage over venti? - erik
Re: [9fans] How to move to rc from sh/bash
It produces the string ' bla$e''o' in rc syntax. The one thing I like about two quoting styles in the Bourne shell is that I can use it's not so much the number of quotes (there are three, by the way), it's the complex rules. for example: ; /bin/bash $ x=1 $ echo $x 1 $ echo '$x' $x $ echo `echo \$x` 1 - reparsing rule. $ echo '$x' '1' $ echo '\$x' '$x' but $ echo `echo The proper is if [ $bla -eq $otherbla ]; then : fi The advantage of rc is that that : is not necessary! Oh, and let's not forget what happens when bla or otherbla is nil! In rc, if (~ $bla $otherbla) { } is all that is needed - no hooks. that's actually a problem. while ~ is nice, it only does shell matching. what if you want regexp matching or test (aka on unix [) operators? then you have exactly the same problem with missing variables. And what I dislike: - [2=] is not the same as [2]/dev/null (some programs crash with the former this isn't a shell issue. [2=] closes fd 2. it's not clear to me that arbitrary plan 9 programs are expected to run without one of the three fds they've been promised by convention. - erik
Re: [9fans] Hello Assembly
There's an OS (complete with a Window Manager, IDE, Web Browser, and even some games) written entirely in assembly: http://www.menuetos.net/ Everyone has 24 hours in a day, but some use it more than others ;) i can see from their documentation, that i have been using my time quite a bit more effectively: Menuet has no roots within UNIX or the POSIX standards, nor is it based on any particular operating system. The design goal has been to remove the extra layers between different parts of an OS, which normally complicate programming and create bugs. here's their write system call: rbx - 1 Write rcx - Ignored rdx - Bytes to save rex - Pointer to data rfx - Filename pointer !? - erik
Re: [9fans] Hello Assembly
One more thing. Does anyone know if, in raw x86 assembly, RET implies STI? Thanks. if it did, it would be impossible to call a function with interrupts off. - erik
Re: [9fans] How to move to rc from sh/bash
1. Is it possible to do command line edit in rc? That is, in bash, both emacs and vi like keybindings can be used (thanks to readline library). But in rc, I have not noticed that yet. As a result, some basic usuages of a shell, such as recalling the previously executed commands, have to be done by mouse (snarf and paste). command line editing is provided by acme in the case of win, or rio(1) directly. not hold mode entered by typing esc. 2. In non-interactive use (script programming), what's the main advantages of rc over sh/bash? tom duff's original paper is in /sys/doc/rc.ps. i don't think i can make a better argument for rc than that. personally, i think the regularized grammer and quoting pay big dividends. rc is also small. it's not hard to understand the virtual machine its built around. but you'll need to decide for your self. - erik
Re: [9fans] Hello Assembly
I did think that was the case earlier, so I tried: TEXT _main+0(SB), 1, $32 (And also with values ranging from $4 to $32 in increments of $4 just for the heck of it). But it doesn't seem to make any difference in the suicide, apart from the changed value of pc. The error is most likely because of the line (that's the only 7 around there): MOVL $7, 8(SP) But it doesn't complain about: MOVL $1, (SP) so I wonder... you seek: SUBL$value, SP - erik
Re: [9fans] Hello Assembly
actually, there's probably enough space above your current location to (appear to) work, but a further error is hinted in the address given by the trap: 8.out 1183: suicide: invalid address 0x7 in sys call pc=0x104e since 7 is your length value, you've also got an off-by-4 error in your stack offsets. actually, i think there's something else wrong: acid: asm(_main) _main 0x1020SUBL$0x18,SP _main+0x3 0x1023MOVL$0x1,0x0(SP) _main+0xa 0x102aMOVL$string(SB),0x4(FP) _main+0x12 0x1032 MOVL$0x7,0x8(FP) _main+0x1a 0x103a MOVL$0x0,0xc(FP) _main+0x22 0x1042 MOVL$0x0,0x10(FP) _main+0x2a 0x104a MOVL$0x33,AX _main+0x2f 0x104f INTB$0x40 _main+0x31 0x1051 ADDL$0x18,SP _main+0x34 0x1054 RET why does the for the equivalent c pwrite(1, string, 7, 0) i get this acid: asm(main) main 0x1020 SUBL$0x18,SP main+0x3 0x1023 MOVL$0x1,AX main+0x8 0x1028 MOVLAX,0x0(SP) main+0xb 0x102b MOVLstring(SB),AX main+0x11 0x1031MOVLAX,0x4(SP) main+0x15 0x1035MOVL$0x7,AX main+0x1a 0x103aMOVLAX,0x8(SP) main+0x1e 0x103eMOVL$0x0,0xc(SP) main+0x26 0x1046MOVL$0x0,0x10(SP) main+0x2e 0x104eCALLpwrite(SB) main+0x33 0x1053ADDL$0x18,SP main+0x36 0x1056RET - erik
Re: [9fans] Hello Assembly
acid: asm(_main) _main 0x1020 SUBL$0x18,SP _main+0x3 0x1023 MOVL$0x1,0x0(SP) _main+0xa 0x102a MOVL$string(SB),0x4(FP) _main+0x12 0x1032 MOVL$0x7,0x8(FP) _main+0x1a 0x103a MOVL$0x0,0xc(FP) _main+0x22 0x1042 MOVL$0x0,0x10(FP) _main+0x2a 0x104a MOVL$0x33,AX _main+0x2f 0x104f INTB$0x40 _main+0x31 0x1051 ADDL$0x18,SP _main+0x34 0x1054 RET why does the ... SP in the .s get changed to FP unless the offset is 0? - erik
Re: [9fans] Hello Assembly
if you love assembly code, the assembler on Plan 9 is not great. If you love assembly code, you are in need of a CAT scan in my view. The v6 manual entry for as called assembly code the ultimate dead language. If only that had been true. gcc and friends have made the world safe for assembly, and there is more assembly in use than ever. Writing assembly code should be as painful as possible. Plan 9 succeeds in that regard. It's a good thing in my view. ron i don't think that it follows from the fact that assembly language is inappropriately used in a lot of linux software that it should be as hard to use as possible on plan 9. there are some tasks that must be in assembly language. and it's a good tool for learning how the machine works. sometimes, like on really small controllers, it's the best tool for the job. just my 2¢. - erik p.s. relax ron. i promise not to rewrite plan 9 in assembly language.
Re: [9fans] managing windows in rio
By the way, I always thought computer science/engineering experts, a group I am not a member of, would rather have half a keyboard than two mice ;-) i believe that's an accurate description of the first mouse. the left hand mouse had enough buttons to type. http://en.wikipedia.org/wiki/Computer_mouse#Early_mice - erik
Re: [9fans] managing windows in rio
4. to recall commands typed in an rc session without resorting to the middle mouse button (snarf+paste)? russ has to useful scripts and one prints the last comand the other executes it. what they do is grepping /dev/text 5. to make rc auto-scroll for programs that output many pages of text, e. g. a du on a deep directory tree, and to not block them after a single page? middle click, scroll one important difference that may be missed here is that unlike linux, the shell is not responsible for either of these behaviors. rio and acme are the two programs that link against libcomplete thus, when running on the console, there is no completion available. there is a version of rc with research unix-style history. /n/sources/contrib/quanstro/futharc.tgz. it works by saving parsed commands to a file designated by $history. the program history.c can be compiled as - and -p so that -p x would print the last command x executed in any window; - x would repeat that command. grep x $history would search history. 7. to make rc auto-complete commands and not only file/directory names? different OS paradigm == different behavior again, rc isn't doing the completion. rio/acme don't know what the commands might be. this is why tab is not the completion key. it would be inconvient to be disallowed typing tab in any program (save sam). - erik
Re: [9fans] VIA VT8237 SATA/RAID i/o errors, dma doesnt work
I changed sdata.c to: return SDretry if starting dmarequest fails, return SDretry and reseting controller if dma times out, return SDretry on request is done and error signaled, and added a counter that resets the controller if a request was 1000 times retried... you might want to loop internally instead of counting to 1000. (which may be too high. i would think that 2 or 4 would do it. have you seen differently?) if more than one thread is doing i/o to the disk and you have a bad sector, it may take an arbitrary amount of time before you discover this fact. The machine ran the whole night with bodth drives in DMA and heavy load. vacing, pingflooded from outside, ddtest on both drives and still alive! :-) good deal. via's product page www.via.com.tw/en/products/chipsets/southbridge/vt8237/specs.jsp indicates that the nic sata controller are both integrated into the sb. perhaps this extra southbridge configuration (pci.c) would make the sdata hack unnecessary? static void viaset(Pcidev *p, uchar link, uchar irq) { uchar pirq; pirq = pcicfgr8(p, 0x55 + (link 1)); pirq = (link 1)? 0x0f: 0xf0; pirq |= (link 1)? (irq 4): (irq 15); pcicfgw8(p, 0x55 + (link1), pirq); if(p-vid != 0x3177 p-vid != 0x3227) return; /* Set transition time to max */ pcicfgw8(p, 0xec, pcicfgr8(p, 0xec) ~4); pcicfgw8(p, 0xe4, pcicfgr8(p, 0xe4) ~0x80); pcicfgw8(p, 0xe5, pcicfgr8(p, 0xe5) | 0x80); // if(pcicfgr8(p, 0x81) 0x80) // acpiregs = pcicfgr32(p, 0x88) 0xff00; } - erik
Re: [9fans] plan9port rio not serving any fs?
p9p rio doesn't use the Plan 9 file model and is not based on file descriptors. it was written at a much earlier age and is a straight X11 program that emulates the rio look and feel. it used to be called '9wm'. in fact, 9wm is so old that it emulates 8½ back when ptys were really non-standard. ; sed 10qREADME 9wm Version 1.1 Copyright 1994 David Hogan. What is 9wm? 9wm is an X window manager which attempts to emulate the Plan 9 window manager 8-1/2 as far as possible within the constraints imposed by X.
Re: [9fans] Unescaped From in mail items
Acme mail now reports multiple messages in the destination folders such as: 111/ $199 110/ $349 109/ Apple [EMAIL PROTECTED] Tue 19 Jun 2007 iPod Gift Wrapping is now available. upas/nedmail reports that the folder has 0 items in it, Acme mail that it has 136 items. Were the messages on the original server invalid before I started, is acme mail handling them incorrectly when saving, or does upas/fs not interpret them correctly after they've been saved locally? this depends on your perspective. upas says that's invalid. this is what i use to solve the problem by editing the mail. (sed converts to runes -- that's why it is avoided.) - erik ; cat qfrom.c /* * quote from lines without messing with character encoding. * (might rather just undo the character encoding and use sed.) */ #include u.h #include libc.h #include bio.h void qfrom(int fd) { Biobuf b, bo; char *s; int l; if(Binit(b, fd, OREAD) == -1) sysfatal(Binit: %r); if(Binit(bo, 1, OWRITE) == -1) sysfatal(Binit: %r); while(s = Brdstr(b, '\n', 0)){ l = Blinelen(b); if(l = 5) if(memcmp(s, From , 5) == 0) Bputc(bo, ' '); Bwrite(bo, s, l); free(s); } Bterm(b); Bterm(bo); } void usage(void) { fprint(2, usage: qfrom [files...]\n); exits(); } void main(int argc, char **argv) { int fd; ARGBEGIN{ default: usage(); }ARGEND if(*argv == 0){ qfrom(0); exits(); } for(; *argv; argv++){ fd = open(*argv, OREAD); if(fd == -1) sysfatal(open: %r); qfrom(fd); close(fd); } exits(); }
Re: [9fans] VIA VT8237 SATA/RAID i/o errors, dma doesnt work
maybe a little bit too early... ran venti/wrarena on sdC0 last night and in the morining the system was completly freezed. (disk led was off, screen was blank) :-( seems that my dd tests are too simple or run too shortly... i'll attach serial console to the machine and try to reproduce it. cinap you may want to try a block size of 64k in your tests. this may make a difference. - erik
Re: [9fans] A newbie question...
9fans.net/archive - erik
Re: [9fans] VIA VT8237 SATA/RAID i/o errors, dma doesnt work
i choose that blocksize because the I/O erros printed by venti while i first tried to copy arenas showed that blocksize. i conclude for now that doing paralel io on both drives results in I/O errors in short time. reading/writing a single drive, the system hangs/freezes after many hours without a trace. eh. sorry for the stupid suggestion. have you tried reducing the size of the reads? does it still hang with a 32k blocksize? perhaps plan 9 is too fast. :-). - erik
Re: [9fans] OT: USB terminals
``Anyone who remembers what life was like before the USB standard came along will appreciate the transformation it has brought about.'' indeed. Anyone who remembers what life was like before our evil overlords from the Andromeda galaxy arrived will appreciate the transformation they have brought about. 1999 called and wants its thread back. where's that bluetooth stack? ☺ erik
Re: [9fans] VIA VT8237 SATA/RAID i/o errors, dma doesnt work
Now this is very interesting! A friend gave me an Adaptec (it really is an SiL) 2xSATA PCI controller [1] for testing, and i was able to generate I/O errors just by reading from both drives in paralel! Does anybody run multiple SATA drives in IDE-mode without problems under Plan9? [1] pci -v 0.20.0: disk 01.80.01 1095/3112 15 0:fb01 16 1:fa01 16 2:f901 16 3:f801 16 4:f701 16 5:fdffd000 512 Silicon Image, Inc. SiI 3112 SATALink/SATARaid Controller cinap yes. i have a cpu server with an nforce-based motherboard and two sata hard drives recognized as ide. i have never had a problem with the ide emulation on this motherboard. i think there is insufficient evidence to jump to the conclusion that plan 9 has trouble with 1 sata drive accessed via ide emulation. if linux uses ide emulation with the same ata commands transfer sizes, do you get the same errors? (do you notice any performance funnies?) we have a sata protcol analyzer. we've seen some mighty interesting things with it. for instance, some hard drive firmware generates sata protocol violations when pushed hard. and some hard drive firmware generates sata protocol violations with very little load. generally hard drives, when they do this send a few data FISes but forget to finish the transaction. this causes the chipset to wait forever. this can look something like what you are seeing. on the other hand, there are reports of via chipsets having trouble dealing with concurrent access and we have also seen chipsets generating sata protocol violations. it could be that the linux driver has exactly this problem but notices that it's hung up and has a few tricky moves to get the device unstuck. - erik
Re: [9fans] VIA VT8237 SATA/RAID i/o errors, dma doesnt work
block sizes dont seem to matter, tried from 512 bytes to 64K in the adaptec case. i also get no errors in /dev/kprint. just read() returns Eio. i have no knowledge of IDE or SATA interfaces, so i'm a little bit lost in the code. :-( the chipset specific IDE code in linux seens to set mostly some timing related control registers, but doesnt change the logic how error conditions are handled as far as i can see. maybe it does by switching some important quirk flags but its not obvious to me. i would like to raise the debug level of sdata.c, just set any bit and got flooded with messages. so it would be great if you could hint me on some interesting debug cases where to look. many thanks so far for the quick responses! :-) cinap is it possible you are reading or writing outside the bounds of the partition? - erik
Re: [9fans] Plan 9 wireless how-to...
Assuming I am not wrong with that point, there must be some sort of unofficial/contributed drivers for OHCI on Plan 9. Instructions on how to install/configure them will be useful, I suppose. not that i'm aware of. - erik
Re: [9fans] VIA VT8237 SATA/RAID i/o errors, dma doesnt work
...then i get i/o errors in venti and plan9 paniced. so this was not such a good idea i guess... reformated all venti partitions and tried again several times with different bios options (without DMA, tried both bios SATA IDE and SATA RAID mode): - after hours of disk activity, sdD0 failed... i tried to read /dev/sdD0/data and got i/o error instantly and after reboot worked again. does it work with a single disk? what is the output of pci? is there any part of the error message that you can capture? - erik
Re: [9fans] Re: 9P, procedure calls, kernel, confusion. :(
one thing of note, linux vfs implements a dcache. this connects the virtual memory system to the filesystem. (but oddly in linux network buffers are handled seperately.) there is no client-side caching in the plan 9 kernel. there is a notable exception. there is an executable cache. One more point, I googled a lot on kernel resident file systems and non kernel resident file systems, but I could not find a single useful link. It would be great if you could specify the difference between the two. I wish that eases up the situation a bit. since the devtab[] functions map 1:1 with 9p, all the mount driver needs to do for calls outside the kernel is to marshal/demarshal 9p messages. it's important to remember that most in-kernel file servers could easily exist outside the kernel. the entire ip stack can be implemented from user space. (and it has been in the past.) Kernel resident filesystem in this context simply means a filesystem which was created for use by the kernel; this may or may not be visible to user-space applications - I'm not too sure. every element of mounttab[] has an associated device letter. to mount the device, one does (typically) bind -a '#'^$letter /dev for example, to bind a second ip stack on /net.alt, bind -a '#I1' /net.alt To sum up, you use the 9 primitive operations provided by each 'Dev' when you work with kernel-resident filesystems, while all other filesystems are dealt with using regular 9P. all devices are accessed through devtab. it may be that that entry is the mount driver. the mount driver turns devtab[]-fn into the corresponding 9p message. (and vice versa.) - erik
[9fans] killer faces
i've been running a derivative of faces for a couple of years now that i just put on sources /n/sources/contrib/quanstro/src/faces. the middle button selects a face. vwhois faces can't be selected. when a face is selected, a box is drawn around it and a guideish bar is printed: Del | subject line goes here middle click on Del deletes the message. - erik
Re: [9fans] Re: 9P, procedure calls, kernel, confusion. :(
see bind(2): Finally, the MCACHE flag, valid for mount only, turns on caching for files made available by the mount. By default, file contents are always retrieved from the server. With caching enabled, the kernel may instead use a local cache to satisfy read(5) requests for files accessible through this mount point. The currency of cached data for a file is ver- ified at each open(5) of the file from this client machine. sleezy hacks notwithstanding. - erik
Re: [9fans] A newbie question...
Some other reasons: - Some systems (read: Linux) do not have pthreads incorrect. http://en.wikipedia.org/wiki/Native_POSIX_Thread_Library - C99 is still new and although it's in POSIX, not many systems have it (Plan 9 doesn't have complete C99) c99 is 9 years old! - erik
Re: [9fans] A newbie question...
it would help to have intel and amd drivers based on published documentation. i don't have the amd (ati) link handy, but here's the link matt offered the other day: http://intellinuxgraphics.org/documentation.html - erik
Re: [9fans] new 9load report
hello, I tried the 5th of November iso (which I guess uses the new 9load) and here goes the report: PBS1... Plan 9 from Bell Labs ELCR: 0C00 Initial probe, to find plan9.ini... dev A0 port 1F0 config 85C0 capabilities 0F00 mwdma 0407 pcirouting 8086/27DF at pin 1 irq 10 dev A0 port 18D0 config 045A capabilities 2F00 mwdma 0007 udma 203F LLBA sectors 117231408 ahci0 port 0xd4544400: hba sss 0; ncs 31; coal 0; mports 3; led 1; clo 1; ems 0; intel 63[12]xesb: sata-I ports with 2 ports FLAGS=10282 TRAP=e ECODE=0 PC=8002a3a0 AX f000ff6b BX 80039f64 CX f000ff53 DX 03d5 SI 80037e50 DI 0002 BP 0008 CS 0010 DS 0008 ES 0008 FS 0008 GS 0008 CR0 8011 CR2 f000ff6b CR3 c000 panic: exception/interrupt 14 in reviewing my email i found this unfinished business. i believe this bug in the ahci driver has been fixed and is in current releases. it was my fault. - erik
Re: [9fans] A newbie question...
So what are the facts to back up so many posts regarding autotools badness? Just curious. part of the issue is that autotool solves a problem that doesn't exist on plan 9 systems. one doesn't need to test for compilers, exotic library problems or portability issues. (small rant: unfortunately, porting a lot of gnu stuff to plan 9 makes some sort of compatability goo necessary again.) another problem with autoconf is it encourages a style of programming that exploits every last nook and cranny of a system's compiler's capabilities when the vast majority of applications will do just fine with the least common denominator. if one's goal is to run on a variety of unix systems, this just is poor engineering. as a case in point, my sacrificial linux machine is a 993mhz pIII. mplayer, an application one would think would benefit from fancy optimizations on such a slow machine, shows absolutely no visible performance benefit from sse2 instructions. it is fast enough already. imho, p9p and russ' unix extracts from p9p show a much cleaner way to port unix stuff. his method requires about 10 lines of system-specific stuff and about 75 lines of Makefile. one last gripe: autotools often take longer to ./configure than to compile with gcc. curious that gcc is famed for slowness. - erik
Re: [9fans] Color change?
Hello. I just went up from a 24-bit display to a 32-bit display in QEMU, and I noticed that rio, acme, and games/mahjongg had different colors. Is this normal/expected/in the source or images? Thanks. no. - erik
Re: [9fans] A newbie question...
An alternative interpretation is that the facts are skewed by the Bell Labs reality distortion field. The syllogism goes something like this: All things not made at Bell Labs are bad GNU is not made at Bell Labs Therefore, GNU is bad if this holds, then plan 9 uses ip, smtp, dns, ntp, ethernet, x86, c. these were not invented at bell labs thus using plan 9 is bad. - erik