[9fans] coherence function in kernel (especially in raspberry pi port)

2017-03-30 Thread yoann padioleau
Hi, What is exactly the logic of the calls to coherence? When do we need to call coherence in the kernel? For example I see this code in bcm/taslock.c coherence(); l->key = 0; coherence(); bcm/taslock.c seems actually mostly a copy paste of port/taslock.c with an extra ca

Re: [9fans] fail to crosscompile Rasperry Pi Miller's kernel

2017-01-16 Thread yoann padioleau
Without -f I was able to get something on the screen. The code in libdraw and libmemdraw does not use floats. But I was having weird failures in malloc. I updated my kencc fork to the latest version and now everything works! The problem apparently was more related to 5c than 5l. I updated 5l to su

[9fans] fail to crosscompile Rasperry Pi Miller's kernel

2017-01-13 Thread yoann padioleau
Hi, I am trying to compile the plan9 kernel for the Rasperry pi from Richard Miller. I am using from MacOSX the kencc toolchain https://code.google.com/hosting/moved?project=ken-cc now https://bitbucket.org/plan9-from-bell-labs/9-cc/

[9fans] website

2015-10-29 Thread yoann padioleau
The website is down?

[9fans] bug in network stack regarding Ipht

2015-06-08 Thread yoann padioleau
Hi, I think I’ve found a bug in the network stack. in 9/ip/ip.h there is struct Ipht { Lock; Iphash *tab[Nipht]; }; where Night is 521, but then in 9/ip/ipaux.c there is ulong iphash(uchar *sa, ushort sp, uchar *da, ushort dp) { return ((sa[IPaddrlen-1]<<24) ^ (sp << 16

Re: [9fans] setitimer equivalent, and sigvtalarm equivalent

2015-05-02 Thread yoann padioleau
Hi, Yes I think you’re right. Indeed the machine has one timer interrupt and it’s enough for the kernel to demultiplex it over many processes who each can have different alarm requirments. Thx. > On May 2, 2015, at 8:06 AM, erik quanstrom wrote: > >> I’m not sure I understand your proposal. >>

Re: [9fans] setitimer equivalent, and sigvtalarm equivalent

2015-04-30 Thread yoann padioleau
Hi, I’m not sure I understand your proposal. But looking more at the code I need to port, an interpreter, I think the main issue is that the interpreter relies on sigvtalarm as a way to preempt the interpreted program while allowing the user program to use only sigalarm. So more generally the pro

[9fans] setitimer equivalent

2015-04-28 Thread yoann padioleau
Hi, I’m trying to port some code to plan9 using APE but I can’t find the setitimer function in any include/ape/ files. What is the equivalent to setitimer under plan9?

Re: [9fans] memory bug in 5l

2014-12-15 Thread yoann padioleau
Right, but the same code in 8l does the while loop, and most of the code in 5l does the while loop, so for consistency it seems it should also be a while loop here. On Dec 10, 2014, at 2:07 AM, Charles Forsyth wrote: > > On Wed, Dec 10, 2014 at 1:19 AM, yoann padioleau > wrote: &g

Re: [9fans] memory bug in 5l

2014-12-09 Thread yoann padioleau
malloc(sizeof(Prog)) On Dec 9, 2014, at 4:21 PM, yoann padioleau wrote: > in 5l/obj.c#zaddr() > there is: > case D_FCONST: > while(nhunk < sizeof(Ieee)) > gethunk(); > a->ieee = (Ieee*)hunk; > nhun

Re: [9fans] memory bug in 5l

2014-12-09 Thread yoann padioleau
Also, by curiosity, does anybody know why 5a/, 5l/, 5c/ (and the other architecture variants) are redefining malloc and free? Why not using the malloc and free from the libc? On Dec 9, 2014, at 4:21 PM, yoann padioleau wrote: > in 5l/obj.c#zaddr() > there is: > case

[9fans] memory bug in 5l

2014-12-09 Thread yoann padioleau
in 5l/obj.c#zaddr() there is: case D_FCONST: while(nhunk < sizeof(Ieee)) gethunk(); a->ieee = (Ieee*)hunk; nhunk -= NSNAME; hunk += NSNAME; I think it’s a copy paste bug, it should be sizeof(Ieee) inste

Re: [9fans] plan 9 on github

2014-12-08 Thread yoann padioleau
This is great! Thx! I had a few bug reports on the kernel that I think never got included in the mainline plan9. Should I make pull requests? Is there anyway this github repo could be synchronized with the main plan9-labs repo? On Dec 8, 2014, at 11:52 AM, David du Colombier <0in...@gmail.com>

Re: [9fans] Porting plan9

2014-12-02 Thread yoann padioleau
I think one of the reason 9load is quite complicated is because they wanted to boot a kernel from the network, so you need a network stack and the drivers for the ethernet card, so you really need lots of OS code in the end. On Dec 2, 2014, at 2:28 PM, Enrico Weigelt, metux IT consult wrote:

Re: [9fans] copy paste bug in cc.y?

2014-10-21 Thread Yoann Padioleau
but (0:int + x) would not do the same thing? What is special about using SUB instead of ADD? On Oct 17, 2014, at 12:07 PM, Charles Forsyth mailto:charles.fors...@gmail.com>> wrote: On 17 October 2014 18:48, Yoann Padioleau mailto:p...@fb.com>> wrote: Somehow? Would be ni

Re: [9fans] gsoc reunion

2014-10-20 Thread Yoann Padioleau
Hi, What is this event? When exactly and where it is? Might be nice to meet some other plan9 enthousiasts. On Oct 18, 2014, at 9:10 AM, yy wrote: > Is anybody going to the GSoC reunion organized by Google next weekend > in San Jose? I will be there from Thursday to Sunday. Let me know if > you

Re: [9fans] copy paste bug in cc.y?

2014-10-17 Thread Yoann Padioleau
:) Got it :) On Oct 17, 2014, at 1:04 PM, minux mailto:minux...@gmail.com>> wrote: On Fri, Oct 17, 2014 at 4:00 PM, Yoann Padioleau mailto:p...@fb.com>> wrote: 0:int - x was not enough for those balancing(?) and promoting thing? It's enough for type promotion, but you chan

Re: [9fans] copy paste bug in cc.y?

2014-10-17 Thread Yoann Padioleau
0:int - x was not enough for those balancing(?) and promoting thing? On Oct 17, 2014, at 12:07 PM, Charles Forsyth mailto:charles.fors...@gmail.com>> wrote: it's building a tree for (0:int-(0:int-x)) which later transformations will simplify to x, but having done "the usual arithmetic conve

[9fans] kencc benchmark vs gcc

2014-10-17 Thread Yoann Padioleau
Hi, Is there any benchmark results comparing kencc (e.g. 8c) vs gcc, clang, etc? I’m interested mainly in the speed of the generated code, not so much in the time it takes to compile something.

Re: [9fans] copy paste bug in cc.y?

2014-10-17 Thread Yoann Padioleau
at 5:50 PM, Rob Pike mailto:robp...@gmail.com>> wrote: It's not dead code. It's prepping the switch somehow. -rob On Tue, Oct 14, 2014 at 3:45 PM, Rob Pike mailto:robp...@gmail.com>> wrote: Looks like it. -rob On Tue, Oct 14, 2014 at 3:11 PM, Yoann Padioleau mai

[9fans] copy paste bug in cc.y?

2014-10-14 Thread Yoann Padioleau
Hi, It’s a copy paste bug here right? https://code.google.com/p/ken-cc/source/browse/src/cmd/cc/cc.y#476 | LSWITCH '(' cexpr ')' stmnt { $$ = new(OCONST, Z, Z); $$->vconst = 0; $$->type = types[TINT]; $3 = new(OSU

Re: [9fans] Announcing The Virtual Plan 9 Server Cookbook

2014-08-29 Thread Yoann Padioleau
This is great. Pdf please! On Aug 28, 2014, at 9:59 PM, Scott Elcomb wrote: > On Thu, Aug 28, 2014 at 9:25 AM, David L. Craig wrote: >> If a lot of people think CSS-challenged newbies >> would have a better experience with a default black-on-white >> presentation, I'll go with that. > > Thanks

Re: [9fans] Brasil

2014-07-18 Thread Yoann Padioleau
I thought it was the old name of plan9: http://swtch.com/plan9history/?p=1999/1031;v=difflist On Jul 17, 2014, at 6:27 PM, Shane Morris mailto:edgecombe...@gmail.com>> wrote: Hello 9fans, I've been doing some research, and come across Brasil, which, if I've got this right, was a co-operating

Re: [9fans] simplest disk filesystem

2014-07-16 Thread Yoann Padioleau
Yes, maybe you’re right :) I’ll probably stick to the idea on just focus on devroot.c as someone suggested. On Jul 16, 2014, at 11:17 AM, s...@9front.org wrote: > It just seems like creating a fake os (as in, no one even intends > to use this os) from scratch in order to explain a real os (as i

Re: [9fans] simplest disk filesystem

2014-07-15 Thread Yoann Padioleau
I’m trying to make a tutorial explaining the code of a not too large kernel (9), but there are too many things to explain so I have to cut things. So having a simple fs which does not require to explain 9p, the rpc, the mount device, etc would be great. I know that explaining plan9 without 9p is ki

Re: [9fans] simplest disk filesystem

2014-07-15 Thread Yoann Padioleau
But I would like something that actually can persist … a real but simple storage persistent filesystem. On Jul 15, 2014, at 10:57 AM, andrey mirtchovski wrote: > /sys/src/cmd/ramfs.c? > > On Tue, Jul 15, 2014 at 11:53 AM, Yoann Padioleau wrote: >> Hi, >> >> W

[9fans] simplest disk filesystem

2014-07-15 Thread Yoann Padioleau
Hi, What is the simplest storage filesystem in terms of code size in plan9? I’m looking for a very simple in-kernel filesystem. Maybe older version of plan9 was including such a filesystem? On Linux for instance the minixfs was probably the simplest filesystem. The dos must also be simple but it’s

Re: [9fans] Cross-compiling Plan 9

2014-07-14 Thread Yoann Padioleau
Yep, I did exactly the same. With kencc+a-few-patches+plan9port+few-symlinks you can easily cross compile plan9. See my kencc fork changes: https://github.com/aryx/fork-kencc/commits/master (and my fork 9 fork: https://github.com/aryx/fork-plan9 ) On Jul 14, 2014, at 3:19 PM, David du Colombier <

Re: [9fans] Cross-compiling Plan 9

2014-07-07 Thread Yoann Padioleau
//github.com/aryx/fork-kencc/commit/160e42f7db33acc7b48e89d5999f5ec3a9c49993 ... On Jul 7, 2014, at 11:34 AM, Charles Forsyth mailto:charles.fors...@gmail.com>> wrote: On 7 July 2014 18:41, Yoann Padioleau mailto:p...@fb.com>> wrote: The first thing was to compile the plan9 C

Re: [9fans] Cross-compiling Plan 9

2014-07-07 Thread Yoann Padioleau
Hi, I was able to cross compile Plan9 from MacOS which is probably quite similar to cross compiling from Linux. The first thing was to compile the plan9 C compilers on MacOS. I used https://code.google.com/p/ken-cc/ because this fork of the Plan9 C compilers are easier to compile on non-plan9 OSe

Re: [9fans] bug in procwired() for x86 scheduler?

2014-06-23 Thread Yoann Padioleau
Yes I agree, it's better that way. Is there a list somewhere on the web with all those 9atom patches? On Jun 22, 2014, at 5:57 PM, erik quanstrom wrote: >> On 22 June 2014 23:25, Yoann Padioleau wrote: >> >>> if(up != p && (p->wired == nil || p->wir

Re: [9fans] bug in procwired() for x86 scheduler?

2014-06-22 Thread Yoann Padioleau
The code should be if(up != p && (p->wired == nil || p->wired == MACHP(m->machno)) m->readied = p; no? > > if(up != p && (p->wired == nil || p->wired == m)) > m->readied = p; /* group scheduling */ On Jun 22, 2014, at 10:20 AM,

Re: [9fans] [GSOC] plan9 kernel scheduler

2014-06-21 Thread Yoann Padioleau
if you look in sys/src/9/port and grep for functions like sched() schedinit() runproc() updatecpu() repriotirize() you'll get the logic of the scheduling algorithm. It's mostly priority queue fair robin I think, with a few hooks to prefer reschedule on the same CPU. Context switching is done wit

[9fans] crashing plan9 source boot CD with key combination (buffer overflow)

2014-06-20 Thread Yoann Padioleau
Hi, There is another buffer overflow somewhere I think. The code in kbdputsc() in kbd.c does not look very safe: kbscan->kc[kbscan->nk++] = c; <- no bound checking, can overflow. c = latin1(kbscan->kc, kbscan->nk); if(c < -1) /* need

Re: [9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread Yoann Padioleau
Well, hard to grep for '3' in a big codebase. They should have used UTFMAX in the first place. I see though that currently in libc.h I have enum { UTFmax = 4,/* maximum bytes per rune */ Runesync= 0x80, /* cannot represent part of a UTF seque

[9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread Yoann Padioleau
Hi, In devcons.c there is /* * Put character, possibly a rune, into read queue at interrupt time. * Called at interrupt time to process a character. */ int kbdputc(Queue*, int ch) { int i, n; char buf[3]; <- enough? Rune r; char *next; if(kbd.ir =

Re: [9fans] other kernel bug

2014-06-09 Thread Yoann Padioleau
Hi cinap, Would it be possible to change a bit the 9front mercurial repository so that it can work on MacOS filesystem. I get some: abort: case-folding collision between sys/lib/troff/font/devutf/charlib/lH and sys/lib/troff/font/devutf/charlib/LH when hg pull; hg update. I can understand the

[9fans] kernel possible double free

2014-06-09 Thread Yoann Padioleau
Hi, I think I've found a possible situation where we call two times free on the same pointer. in sysexec() there is essentially sysexec(...) { … if(waserror()){ free(file0); free(elem); nexterror(); } for(;;){

Re: [9fans] 9pi on qemu failure

2014-06-09 Thread Yoann Padioleau
Hi, I have a raspberry pi :) but I've found it incredibly convenient to have an emulator to test things. The development iterative loop is far faster when you can cross-compile from your pc and test directly on your pc. Then once it works you can deploy and test on the real machine. Anyway, I un

[9fans] 9pi on qemu failure

2014-06-07 Thread Yoann Padioleau
Hi, I've tried to run 9pi from richard miller on qemu but failed http://plan9.bell-labs.com/sources/contrib/miller/ qemu-system-arm -cpu arm1176 -m 512 -M versatilepb -kernel 9pi qemu: fatal: Trying to execute code outside RAM or ROM at 0x80010028 R00= R01=00052078 R02=0552 R03=0

[9fans] advanced core Linux kernel features not in plan9

2014-06-06 Thread Yoann Padioleau
Hi, I was curious to know which core features of the Linux kernel are not implemented in the plan9 kernel. By core I mean that I know plan9 does not have all the drivers, filesystems, buses, etc Linux has, but it has many of its core features (virtual memory, paging, swapping, demand loading, co

Re: [9fans] What is Plan9 exactly?

2014-06-05 Thread Yoann Padioleau
Nice! On Jun 4, 2014, at 8:14 PM, s...@9front.org wrote: > https://urldefense.proofpoint.com/v1/url?u=http://code.google.com/p/plan9front/wiki/fqa0&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=%2FN9d7W2LRwZks3eyFNLr8Q%3D%3D%0A&m=932ql2s0yZzSIWvDmA7Ow3MAsKVfP6fSFQC%2Fj%2BdntMU%3D%0A&s=5073da3bad45a50f3d327

[9fans] other kernel bug

2014-06-04 Thread Yoann Padioleau
Hi, I think I've found another one :) in confinit() we do: kmem -= conf.upages*sizeof(Page) + conf.nproc*sizeof(Proc) + conf.nimage*sizeof(KImage) + conf.nswap + conf.nswppo*sizeof(Page); // <- BUG but in swapinit we actually do iolist = x

[9fans] minor kernel bug

2014-06-04 Thread Yoann Padioleau
Hi, Here is a patch for tasklock.c: int lock(Lock *l) { int i; ulong pc; pc = getcallerpc(&l); lockstats.locks++; if(up) inccnt(&up->nlocks);/* prevent being scheded */ if(tas(&l->key) == 0){ if(up)

[9fans] kernel bug

2014-06-02 Thread Yoann Padioleau
Hi, in the newseg() function there is: mapsize = ROUND(size, PTEPERTAB)/PTEPERTAB; if(mapsize > nelem(s->ssegmap)){ mapsize *= 2; if(mapsize > (SEGMAPSIZE*PTEPERTAB)) mapsize = (SEGMAPSIZE*PTEPERTAB); s->map = smalloc(mapsize*sizeof(Pte*)); s->m

Re: [9fans] why u.h, why qid?

2014-05-09 Thread Yoann Padioleau
No answer? Nobody knows or my question is stupid? I really search for the history of QID and why this Q but could not find anything … On May 7, 2014, at 10:45 PM, Yoann Padioleau wrote: > Hi, > > I was wondering what was the reasons for the name u.h? Is it because > it has lots

[9fans] why u.h, why qid?

2014-05-07 Thread Yoann Padioleau
Hi, I was wondering what was the reasons for the name u.h? Is it because it has lots of uxxx type in it? Also what is the meaning of Qid. What the Q stands for?

Re: [9fans] Raspberry Pi image

2014-02-18 Thread Yoann Padioleau
Yes, thx Richard. But how this image was produced? just mk in the sys/src/9/bcm/ official plan9 distribution or do you have a custom plan9? On Feb 18, 2014, at 1:05 PM, Richard Miller <9f...@hamnavoe.com> wrote: >> Thank you for creating the Raspberry Pi port. I had always wanted to >> use Pl

Re: [9fans] networking, qemu, and telnet

2014-01-24 Thread Yoann Padioleau
net unreachable, same than with the telnet command. On Jan 24, 2014, at 7:44 PM, Skip Tavakkolian mailto:skip.tavakkol...@gmail.com>> wrote: con tcp!host!telnet On Fri, Jan 24, 2014 at 6:23 PM, Yoann Padioleau mailto:p...@fb.com>> wrote: > > ip/ipconfig 10.0.2.2 > also

Re: [9fans] networking, qemu, and telnet

2014-01-24 Thread Yoann Padioleau
> > ip/ipconfig 10.0.2.2 > also works which is great. Sorry, I meant ip/ping 10.0.2.2 works > > Now I would like to do some very basic test by from plan9 telneting into the > host. > But when I do > % telnet 10.0.2.2 > I get > telnet: tcp!10.0.2.2!telnet: net unreachable. > > Note that telnet

[9fans] networking, qemu, and telnet

2014-01-24 Thread Yoann Padioleau
Hi, I'm able to ping from plan9 the host (the macos machine running qemu). After % ip/ipconfig % ndb/dns -r I have something in /net/ndb and running ndb/dnsquery and entering address like www.google.com works. ip/ipconfig 10.0.2.2 also works which is great. Now I would like to do some very basi

[9fans] about KTZERO mismatch in mkfile and mem.h

2014-01-20 Thread Yoann Padioleau
Hi, in 9/pc/mem.h it says: /* * Address spaces */ #define KZERO 0xF000 /* base of kernel address space */ #define KTZERO (KZERO+0x10)/* first address in kernel text - 9load sits below */ and in 9/pc/mkfile: # must match mem.h APBOOTSTRAP=0xF00

Re: [9fans] mechanism to bind partitions in /dev?

2014-01-18 Thread Yoann Padioleau
. brucee On 18 January 2014 17:57, Yoann Padioleau mailto:p...@fb.com>> wrote: Hi, Can someone explain how the partitions in /dev/sdC0/xxx are populated? Who create those device files? I have a small plan9 kernel running a small shell (sh.Z) in memory and when I do 'bind #S/sdC0 /dev/&

[9fans] mechanism to bind partitions in /dev?

2014-01-17 Thread Yoann Padioleau
Hi, Can someone explain how the partitions in /dev/sdC0/xxx are populated? Who create those device files? I have a small plan9 kernel running a small shell (sh.Z) in memory and when I do 'bind #S/sdC0 /dev/' I just see the 'data', 'ctl', and 'raw' files. There is no 9fat or plan9 or whatever pa

[9fans] qemu and networking

2014-01-07 Thread Yoann Padioleau
Hi, I've installed plan9 on a plan9.raw.img file via qemu and I'm able to boot on it. How can I transfer files between plan9 and my host (I'm under macos)? I've followed http://plan9.bell-labs.com/wiki/plan9/installing_plan_9_on_qemu/index.html and run qemu -hda Plan9.qcow2.img -net nic -net u