**** BEGIN LOGGING AT Sun Feb 4 10:53:21 2001 10:53:21 --> RobertFit (~bob@194.125.56.12) has joined #jos 10:53:48 --- RobertFit sets mode +t 10:53:50 --- RobertFit sets mode +n 10:53:52 --- RobertFit has changed the topic to: The JOS Project 12:31:10 --> jewel_ (~jewel@pta-dial-196-31-186-136.mweb.co.za) has joined #jos 12:31:20 Hi John. 12:40:48 Hey Robert 12:42:34 How's it going? 12:43:44 It's been quite busy 12:43:53 But things are coming under control now 12:43:57 How have you been? 12:45:09 I'm good, I've been a little busy in work. 12:45:35 I'm afraid I can't actually chat right now, will you be here in about 15-30 minutes? 12:45:45 Yes. 12:45:56 see you a bit later 12:46:01 Ok. 13:08:49 --> risi (~risi@netapp2.skynet.be) has joined #jos 13:08:51 I'm back 13:09:01 WB. 13:09:07 Hi risi. 13:09:08 <-- risi (~risi@netapp2.skynet.be) has left #jos 13:09:13 * jewel_ 13:09:30 Yes, In December I went to Mozambique to go diving with some friends 13:09:48 January involved a lot of extended new years celebrations and some work on teaseme 13:10:06 In the last few weeks I've been earning some money doing extra maths tuition 13:10:59 Now I'm trying to organise my life so that I can get back to coding 13:11:45 I haven't really done anything except work, I live a very boring lift. :( 13:11:56 :-) 13:12:08 Where are you working now? 13:12:23 I'm still in Ireland, wasn't able to go back into the US. 13:12:49 You weren't able to go back to your old job, or you couldn't get any work in the US? 13:13:28 Visa problems, I'm working on the project from Dublin now. 13:14:03 the US is pretty tight 13:14:15 Yeah, it's a pain. 13:14:35 When Africans want to apply for holiday visas to the US they have to undergo an *interview* before getting it 13:16:18 It a bit better coming from Europe. 13:17:08 So why did they refuse you? 13:18:21 I was there on buisness using a vistor visa for too long. 13:19:07 Ah ok 13:19:17 How long were you there? 13:20:27 About 9 months in total, the vistor visa is for 3 months but you can leave and get a new one. 13:23:39 --> risi (~risi@netapp2.skynet.be) has joined #jos 13:23:43 Did they know that you had been working? 13:23:56 <-- risi (~risi@netapp2.skynet.be) has left #jos 13:26:24 Sort of, I was there on buisness. I work for an Irish company and was just located there as part of a contract between my company and there client in the US. 13:27:42 So what does your company say, are they upset? 13:28:43 It was that big an issue for my company but the clients were a little upset. 13:28:48 wasn't 13:29:47 So you're working from home? 13:30:46 No, our office in Dublin. I've better internet access and our clients systems at work. 13:31:29 How long will you stay on the project? 13:32:02 There's probably another month or two left. 13:32:12 --> risi (~risi@netapp2.skynet.be) has joined #jos 13:32:23 <-- risi (~risi@netapp2.skynet.be) has left #jos 13:32:43 After that, what are your plans? 13:33:11 I don't know yet, depends what the company want to do with me. 13:33:47 you mentioned NZ the last time we spoke 13:34:40 Yeah that could be an option, but I don't know if that's where they'll send me at this point in time. 13:35:33 Have you been doing any coding besides work? 13:36:13 Yes, I've mostly been working on RJK (Robert's JOS Kernel). 13:36:25 --> risi (~risi@netapp2.skynet.be) has joined #jos 13:36:32 <-- risi (~risi@netapp2.skynet.be) has left #jos 13:36:47 It's going quite well I should be ready to make a new release soon. 13:37:25 Cool, what's changed? 13:38:27 IRQ's, timers and threads now work. 13:39:03 Wow, how do the threads work? 13:39:10 Do you have a scheduler? 13:40:24 It's a very simple scheduler at the moment, just round robin over the list of threads. 13:40:55 Cool, I assume you haven't got any synchronisation primitives yet? 13:42:56 I've got most of the atomic operations, stubs for spinlocks, I will probably add lock's and rwlock's. I'm not sure if I need to put monitors in the kernel it might be better to put them in the JVM? 13:43:40 It probably would be 13:43:48 The last week or two I've been redoing the locks for kissme 13:44:07 I've implemented thin locks that use an atomic cmpxchg instruction 13:44:20 And this falls back to a fat lock (pthread mutex) when there is contention 13:44:51 We will need a way for a thread to efficiently wait to be signalled by another thread 13:46:44 Yeah, I think I'll do that in the scheduler. 13:47:26 Is it possible for me to compile it and check it out? 13:48:14 Yeah, I'll package it up in a few minutes, and email it to you? 13:48:43 please 13:48:54 Ok. 14:03:36 John that's on it's way. 14:05:04 got it 14:06:29 Ok, can I boot it with grub? 14:06:35 There is a floppy img you will need to write to a disk, then build the kernel.elf file and copy it to the disk. 14:06:36 What does it do at the moment? 14:07:03 Yes, it uses grub, grub is on the floppy image. 14:07:35 It just starts 3 threads and prints some messages. 14:08:43 so do I need the floppy image if I already have grub? 14:09:27 It might be better for the moment. 14:16:22 ok, I'm busy writing it 14:16:23 --- Disconnected (Remote host closed socket). **** ENDING LOGGING AT Sun Feb 4 14:16:23 2001 **** BEGIN LOGGING AT Sun Feb 4 14:18:43 2001 14:18:43 --> RobertFit (~bob@194.125.56.12) has joined #jos 14:18:43 --- Topic for #jos is The JOS Project 14:18:43 --- Topic for #jos set by RobertFit at Sun Feb 4 10:52:51 2001 14:19:40 Once I've written the image, what do I do? 14:20:19 You then need to build the kernel.elf file and copy it to the floppy disk. 14:20:44 You will then need to reboot a computer with the disk in the floppy drive. 14:21:08 To build, "make all" should work on any linux system. 14:21:39 I can't mount the disk 14:23:04 It's a fat formated disk, you will need to do something like "mount -t vfat /dev/fd0 /floppy". 14:23:21 let me try another disk 14:29:47 that's better 14:29:50 so it's just a grub disk? 14:30:20 Yes, grub is needed to load my kernel. 14:30:38 ok I have to disconnect this monitor to boot the other machine, brb 14:37:31 ok, got it to work 14:37:41 had to use the grub on my HD however 14:38:05 What was the problem? 14:38:47 I don't know, I think I selected the first item on the menu, but it didn't boot (can't remember why) 14:38:48 --> tofventje (~jos_02@netapp4.skynet.be) has joined #jos 14:39:00 <-- tofventje (~jos_02@netapp4.skynet.be) has left #jos 14:43:18 So what do you think of it? 14:43:56 Looks good, I'm busy browsing through the code 14:44:28 what is interrupt eight? 14:44:38 RTC. 14:45:05 Real Time Clock. 14:45:20 Is there any VMM code? 14:45:55 kmemory has a very simple one, it's on my Todo list. 14:47:13 how do you install an interrupt handler? 14:49:45 Function kirq_assign_irq in kirq.c does the work. 14:50:59 The asm interrupt service routines are in entry.S which call the C code handle_irq. 14:52:29 Excellent. Is it possible to load another module with grub at boot time (instead of compiling code into the kernel)? 14:53:56 Not at the moment but that's the plan, I'm going to work on that soon. 14:55:41 That would be very useful 14:56:12 I think I'ld like to try make this new "lock" module that I made for kissme work on kissme/teaseme/rjk 14:56:23 Have you implemented any of the lock interfaces? 14:57:14 Yeah, the goal is to have the all JOS jvm use the kinterface and have multiple implementations of the interface. 14:57:39 Do you really think we'll have other interfaces? 14:57:40 No implementations yet. 14:57:56 How much work would it be to make the linux kernel implement the kinterface? 14:58:06 (I meant other implementations in the first line) 14:58:35 but RJK will 14:59:14 It wouldn't be very hard, RJK and some of the interface functions are based on the Linux kernel. 15:00:34 Where is the pthread implementation in the linux source? 15:00:42 Having a interface like this should allow JOS to be ported to platforms quicker because you can just use the existing kernel as a base. 15:00:47 or is it glibc? 15:00:52 glibc. 15:01:06 hmm, where do I get the glibc source? 15:02:07 cvs -z 9 -d :pserver:anoncvs@anoncvs.cygnus:/cvs/glibc checkout libc 15:03:17 bash-2.03$ cvs -z 9 -d :pserver:anoncvs@cvs.cygnus:/cvs/glibc checkout libc 15:03:18 Unknown host cvs.cygnus. 15:03:36 bash-2.03$ cvs -z 9 -d :pserver:anoncvs@anoncvs.cygnus:/cvs/glibc checkout libc 15:03:37 Unknown host anoncvs.cygnus. 15:03:43 sorry should have anoncvs.cygnus.com 15:04:57 It's a big download ~100Mb. 15:05:41 If you go to sources.redhat.com you should be able to find a tar ball. 15:06:07 ok, well I'm pulling it down now 15:06:12 howcome so big? 15:07:33 It implements the C interface for over 20 platforms. 15:08:25 and everyone has a different kernel interface :-) 15:08:40 Yeap. ;) 15:09:47 --> jos01 (~jos_02@netapp4.skynet.be) has joined #jos 15:09:49 --> Diremnce (~Diremnce@nchobo01.telenet-ops.be) has joined #jos 15:09:54 iepz 15:09:59 <-- jos01 (~jos_02@netapp4.skynet.be) has left #jos 15:10:32 <-- Diremnce (~Diremnce@nchobo01.telenet-ops.be) has left #jos 15:10:44 There are 11 Changelogs 15:11:16 Going back to 1992. 15:11:33 Sorry 1991. 15:11:59 In a way, implementing a Java platform is similar to what glibc has done 15:12:04 except we need a kernel too 15:12:15 Brb, I've to get some lunch. 15:12:29 ok 15:21:03 I'm back. 15:26:02 What type of functions do you need in a lock interface? 15:26:35 the first is a just a normal mutual exclusion lock 15:26:52 ie, if one thread has the lock, any other threads must block efficiently until it is free'ed 15:27:39 then I need a similar lock, but it must recursive, ie the owning thread can lock it multiple times 15:28:13 and then a "condition" variable which allows a thread to send a signal to one or waiting threads 15:28:16 Would a read/write lock work for this? 15:28:24 those threads must sleep efficiently while waiting for the signal 15:28:45 What do you mean by a read/write lock? 15:28:54 A lock that prohibits both reading and writing? 15:29:27 A lock that allows multiple reads or one writer at a time. 15:30:11 Yes, but we would just use the write functionality 15:50:18 Does this look right? 15:50:46 while(true) { 15:51:17 if(katomic_compare_and_set_if_equal(m->mutex, 0, current_thread || 15:51:49 katomic_compare_and_set_if_equal(m->mutex, current_thread, current_thread)) 15:52:03 (m->mutex_count)++; 15:52:06 else 15:52:15 kthread_yield(); 15:52:16 } 15:52:44 the exit function would be: 15:52:55 if(--(m->mutex_count)) 15:53:18 katomic_set(m->mutex, 0); 15:56:00 how do you know the expression after the || will be executed after the first one? 15:56:28 are m->mutex and current_thread 32 bit ints 15:57:03 A kuint in the kinterface is the same size as a pointer. 15:57:05 the exit function must check if the current thread owns the mutex 15:57:45 Are you sure? 15:57:57 With valid bytecode? 15:58:06 Oh I see, the order of the compare_and_set's doesn't matter 15:58:37 Well we don't want to depend on the bytecode 15:58:49 The JVM itself will be using these methods, and there might be a bug there 15:58:58 You would pick the best order to use maybe the check for the current_thread equal m->mutex should be done first. 15:59:21 the order of compares. 15:59:37 the second compare doesn't need to be atomic 15:59:52 if we own the lock, noone else is going to change it while we look at it 16:01:16 The second one will to called when someone owns the lock it may not be the current thread. Though it doesn't have to be a compare and set. 16:01:28 I assume kyield() just schedules another thread 16:01:41 Yes. 16:02:21 So it should be: if( m->mutex == current_thread) 16:02:30 inc count 16:02:55 else if( compare_and_set(m->mutex, 0, current_thread)) 16:02:56 But the == isn't atomic. 16:03:00 inc count 16:03:07 else 16:03:10 yield() 16:03:18 it doesn't need to be 16:03:33 because we're only checking for the case when we own the lock 16:04:48 Ok, I see. But you do need to use an atomic compare I'm working on adding one now. 16:05:37 We need the atomic_compare_and_set_if_equal(), do we need a plain atomic_compare? 16:06:09 you mean for the unlock method? 16:06:18 For both. 16:06:32 Where do we need it in the lock method? 16:07:13 The first if, (m->mutex == current_thread) wont work. 16:07:24 why not? 16:08:10 The above is not atomic. 16:08:37 it doesn't need to be 16:09:15 assume the mutex is 0, and we try lock it, if someone changes it while we're doing the test, we'll see some number but it won't be current_thread 16:09:49 if the mutex was current_thread, no-one else will be able to change it 16:11:38 Let me think about this. 16:11:49 :-) 16:15:59 BTW, I'ld like to suggest we move these IRC meeting to irc.openprojects.net 16:16:23 I thinking the same. 16:16:54 We won't be bothered by the Belgians, and the servers are much less lightly loaded 16:18:04 Ok, the next meeting will be on the openprojects IRC network. 16:19:22 --> MX_00 (~MX_00@dh170-186.yucom.be) has joined #jos 16:19:32 speak of the devil 16:19:38 ;) 16:19:48 <-- MX_00 (~MX_00@dh170-186.yucom.be) has left #jos 16:20:29 I'm wondering about the interaction of the first compare and katomic_set in the exit function on SMP system. 16:21:16 so one processor sets the mutex to 0 16:21:26 while another processor is comparing mutex to current_thread 16:21:32 Yes. 16:22:03 I think the compare will see the old value, so it will just come round again for another compare, mmm, maybe come round for _many_ compares 16:22:57 I don't know how the cache works on such systems, will the new value eventually be seen by the other processor? 16:23:39 Does GCC know that it mustn't cache that variable ? 16:23:45 (in a register) 16:23:56 The value will be volatile but I'm still not sure 16:24:22 ok, go for the atomic_compare, better to be safe 16:24:36 We can always change it later. 16:24:48 yes 16:27:34 Is there a way to set the current thread to not only yield, but maybe to miss one or two scheduling opportunities 16:28:05 I'm thinking that if one thread holds a lock for a long time, the other will spend a fair amount of time on the processor just checking for the lock, especially when there are only two threads 16:28:17 At the moment only kthread_sleep. 16:28:55 I think there will be more than two threads, unless the whole JVM is single threaded. 16:29:39 Sure, but even with thousands of threads, if they are all contesting for the same lock it could be inefficient 16:29:57 (but of course they should use then a different kind of lock) 16:30:17 / use then / then use 16:30:33 Yes. 16:42:05 Question, in teaseme where do you store the mutex? 16:43:43 And do you know how much nesting is used? 16:45:20 There is a per-object word which is a thin lock 16:45:31 when it is inflated to a fat lock it points to a new structure 16:45:38 there is a mutex in there 16:45:55 nesting can be infinite 16:46:10 my thin lock nests 255 times 16:46:59 But what's a normal amount, is the mutex normaly free, compare_and_set go first? 16:47:13 shoule compare_and_set go first? 16:47:16 but an integer should be enough for the nesting count 16:47:57 I don't think the mutex will normally be free, because they will be used in the contention case 16:48:11 but the JVM will use these locks to lock it's own structures, and there they will normally be free 16:48:20 I'm wondering should this code/stucture be part of the JVM or the kernel. 16:48:53 Well the question is, will anything else in the kernel use it, does it rely on anything in the kernel? 16:48:56 Or should the one provided by the kernel only be used for the JVM structures. 16:50:19 I currently have two types of locks in mind a spinlock and lock. 16:50:43 we could do that, and then have a special one which the JVM uses for Java locks 16:51:19 The JVM could then inline the enter/exit code etc. 16:51:25 I vaguely remember reading in some of the IBM papers that they implemented some kind of back-off system for locks that were heavily contended 16:51:54 yes, that would give us a speed advantage 16:53:12 Also the kernel interface may not be linked into the jvm, so it would be a system call for each lock. 16:54:22 So does JVM need to be able to nest on the same lock? 16:56:58 At the moment the JVM does use recursive locks 16:57:17 when locking data in classfil.c 17:03:19 I'm trying to minimize the amount of structures in the kernel interface, and it looks like to have you might need a structure. 17:03:41 .. to have a mutex you ... 17:09:50 yip 17:09:56 well leave it out, I can do that in the JVM 17:10:09 but then there must be a way to determine if the current thread owns the lock or not 17:10:36 I'm going to leave soon, there is a thunderstorm (with associated lightning) imminent 17:11:00 It's ok I'm going to add a mutex to the kernel interface. 17:12:52 Couldn't you just make the mutex a void* 17:13:14 There would be less error checking, but it would keep the interface simple 17:13:50 You need to be able to store a thread id and a nesting count. 17:15:23 Yes, you could have the structure inside the kernel, but not in the interface 17:15:37 are you keeping structures out of the interface or the kernel? 17:16:45 The interface, most of the structures are user allocated. 17:17:04 ktime is the only one so far. 17:17:26 The rest are stored inside the kernel. 17:40:58 --> tmiller (~tmiller@165-82-84-50.students.haverford.edu) has joined #jos 17:41:06 Hi Todd 17:41:11 Hi, Robert 17:41:22 * tmiller keeps forgetting that ircii doesn't keep nicks 17:41:25 --- tmiller is now known as _Quinn 17:41:32 <_Quinn> ah, much better :) 17:43:36 How was Chirstmas and New Year? 17:44:43 * RobertFit must remember to to use "the". 17:45:00 Hey Todd 17:45:37 <_Quinn> Hey 17:45:59 I see the lists.sourceforge.net server is having trouble 17:46:00 <_Quinn> Christmas wasn't too shabby. Didn't do much for New Year's. 17:46:08 <_Quinn> is it being slow again? 17:46:24 Well my messages get delayed for more than 2 hours 17:46:30 counts as slow for me :-) 17:46:53 <_Quinn> Yeah, well, we're getting it for free :) 17:47:11 True ... 17:47:25 <_Quinn> Oh, BTW, I was playing around with teaseme in kernel mode yesterday, 17:47:33 get it to run? 17:47:38 <_Quinn> sort of :) 17:47:46 segfault? 17:47:58 <_Quinn> I'd been stripping things out of teaseme.system.init for when I wanted 17:48:05 <_Quinn> to start working on consoles 17:48:27 <_Quinn> and I ran it then. init() just printed its thing, and the computer locked up 17:48:41 <_Quinn> but didn't crash. So I was wondering if something in particular 17:48:50 <_Quinn> had to be done at the end of init() to make teaseme halt. 17:49:11 <_Quinn> (But yes, with your teaseme.system.init, I did get a segfault and I couldn't figure out where because I got too much data) 17:49:14 Hmm, so what was the last message it printed? 17:49:35 <_Quinn> Oops. 17:49:55 <_Quinn> I just checked my init() code, and sure enough, there's an infinite loop at the bottom, 17:50:03 Ok, :-) 17:50:05 <_Quinn> waiting for Servers.shutdownTime. 17:50:16 That is to wait for the other processes to exit 17:50:34 It was a nasty hack, the last server started will set shutdownTime to true 17:50:34 <_Quinn> I don't know -- I got more than a pagefull of segfault information. 17:50:39 <_Quinn> Ah. 17:50:53 <_Quinn> Well, I'm willing to risk removing it and seeing what happens. BBIAB 17:51:38 <_Quinn> Oh, btw -- is there some way to supress the 'cons JSF' messages from makeme? 17:51:52 * jewel_ thinks 17:52:10 Those come from somewhere in the java support code, let me look ... 17:54:39 <-- _Quinn has quit (Ping timeout) 18:02:37 --> _Quinn (~tmiller@165-82-84-50.students.haverford.edu) has joined #jos 18:02:39 <_Quinn> Urg. 18:02:54 <_Quinn> "unable to handle internal paging request"? 18:03:34 <_Quinn> I'm going to give it another shot, once I unmount a few filesystems. BBIAB 18:03:36 <-- _Quinn has quit (Leaving) 18:04:02 what does "unable to handle internal paging request" mean? 18:04:41 I think you get it when you run out of phyiscal memory. 18:05:20 Usually I see something like _try_free_pages being called on all the modules 18:05:44 Wow I got all of libc 18:05:49 How many hours was that :-) 18:06:19 Three. 18:06:43 I've been looking at the linuxthreads impl 18:06:57 They have a lot of 'cruft', or stuff that we won't need in all sorts of structures 18:07:34 They also have scheduling code within their implementation 18:07:43 Although I can't see exactly how it works 18:08:31 They also have lots of READ_MEMORY_BARRIER and WRITE_MEMORY_BARRIER calls 18:10:41 I don't think the i386 use them. 18:11:01 Though the 'lock' might be simalar. 18:12:43 The comments seem to indicate that this for instructions that can be reordered on MP systems such as Alpha machines 18:14:21 We should be ok for awhile then. :) 18:15:25 Hehe 18:17:12 * jewel_ finds a bug in the wait() code 18:17:17 --> _Quinn (~tmiller@165-82-84-50.students.haverford.edu) has joined #jos 18:17:18 <_Quinn> *sigh* 18:17:27 hey todd, what happened? 18:17:46 <_Quinn> "unable to handle internal page request" 18:18:01 <_Quinn> What does teaseme do after init returns? 18:18:02 Robert says thats an OOM error 18:18:27 When init returns the main thread dies 18:18:43 let me see if it does anything else (on kissme it specifically waits for other threads) 18:18:49 <_Quinn> OOM? On a 128 MB machine? 18:19:19 <_Quinn> I was thinking it might be a GC error 18:19:24 Well maybe not. ;) 18:19:39 But if it was a stray pointer then it should oops, right? 18:20:07 It's not a kissme/teaseme error, it's a kernel message 18:20:21 (Of course probably caused by teaseme :-)) 18:20:55 <_Quinn> jewel -- it could have oopsed further back in the trace 18:21:14 possible, is it generating a lot of output? 18:21:28 <_Quinn> Yup, tons. 18:21:39 BTW, the cons JSF isn't in the newer versions of makeme, you can get one of those or just comment out that line in the source 18:22:00 <_Quinn> OK. (Where's makeme, again?) 18:22:08 Let me have a look at it so that reduce the less useful output 18:22:48 <_Quinn> no -- I mean lots of output from the kernel 18:23:03 Ah, of that same message? 18:23:18 <_Quinn> Registers, stack values, that sort of things 18:23:20 <_Quinn> er, thing 18:23:31 http://sourceforge.net/project/showfiles.php?group_id=7443&release_id=19260 18:23:55 Ah, how many threads get started? 18:24:32 Todd, what version of the kernel are you using? 18:24:36 <_Quinn> erps. 18:24:50 <_Quinn> Looks like I left initializeProcessServer() in there. 18:24:53 Did you change your compiler to get it to run? 18:25:09 <_Quinn> Maybe if I get rid of that? 18:25:12 <_Quinn> Robert, a custom build of 2.2.17 18:25:18 <_Quinn> change my compiler? 18:25:20 Yip, take that out 18:25:51 You said earlier it rebooted (or froze) your machine, and we were talking about whether it might be a GCC problem 18:25:52 <_Quinn> huh? 18:25:59 in some emails 18:26:26 <_Quinn> Oh. It's still freezing my machine. It just seems to be getting further, now 18:26:46 Ok, so you're resetting after each run? 18:26:54 <_Quinn> incidentally, the .makemeKernel and .makemeUser in CVS don't seem to include the locks stuff 18:27:03 <_Quinn> jewel: yup. That's why I'm so interested in journalled filesystems :) 18:27:16 Does it freeze even if you leave init() empty 18:27:24 <_Quinn> OK, removed initializeProcessServer. 18:27:31 <_Quinn> john, I can go test that now. 18:27:39 Have you checked out bochs or vmware? 18:28:12 You're testing it on the machine you're on now? 18:28:13 <_Quinn> robert, no, I haven't; I was planning on setting up a second machine, but the network here doesn't like me that much. :) 18:28:27 <_Quinn> Yeah -- that's why I keeping leaving and coming back. 18:29:02 I'm just trying to get a rough idea of where it freezes 18:29:14 <_Quinn> So am I :) 18:29:30 --> jos_00 (~jos_00@netapp2.skynet.be) has joined #jos 18:29:35 <_Quinn> When it ended with an infinite loop, it would print out the bit right before the loop and then just stop. 18:29:49 <-- jos_00 (~jos_00@netapp2.skynet.be) has left #jos 18:30:19 * jewel_ ponders 18:30:34 when kernel threads spin, do they stop other stuff from happening in the kernel? 18:30:42 <_Quinn> So I thought if I removed the infinite loop, everything would be happy. 18:30:44 Yes. 18:31:13 Sorry maybe. 18:31:16 And your code has completed by the time init() returns? 18:31:58 <_Quinn> init.main() was just printing things. I didn't have any code in it yet 18:32:12 The .makemeKernel and .makemeUser files look old 18:32:29 and it still freezes even without the loop? 18:32:33 If interrupts are turned off and a thread spins your in trouble. 18:32:58 Will my thread run with interrupts off (I never turn them off myself) 18:33:08 <_Quinn> jewel -- no, without the loop it dumps kernel messages/panics 18:34:21 and you have to reboot? 18:35:03 <_Quinn> yup 18:35:48 does it ever print out any ..system.printk messages ? 18:36:32 <_Quinn> the last run had two. Right now it's compiled to have nothing in it at all 18:37:08 You see, there is a bug somewhere that messes up the output of those printk messages, and I have no idea where it is. It has never caused a panic or segfault on my machine, but might affect yours 18:37:38 <_Quinn> Hm. Can I just #define away printk? 18:37:49 <_Quinn> (Would that be worth trying?) 18:37:58 I don't think that will make a difference 18:38:18 I think the bug is in all the code leading up to the printk, not the actual printk call 18:38:31 <_Quinn> ? 18:38:41 <_Quinn> printk() from the java code, you mean? 18:38:45 Let me clarify: 18:38:57 There is a method jos.system.machine.printk, which takes a Java String 18:39:05 Eventually this calls the kernel C method, printk 18:39:14 <_Quinn> Right. 18:39:29 <_Quinn> jos.system.machine.printk->printk 18:39:42 Robert, is it possible for one of the teaseme threads to get scheduled with interrupts turned off? 18:40:16 Yes, but that involves quite a lot of code in StringBuffer and String, which in turn execute other things, so it's very difficult for me to track down the error 18:40:52 The panic could also be something totally different 18:41:18 <_Quinn> RIght. 18:42:01 Ok, let me write this down quickly, when you run "out of the box" it freezes? 18:42:34 <_Quinn> No, with your code it gets some lovely kernel error. 18:42:56 Ok, then what did you remove? 18:43:30 <_Quinn> Most of it. What remained was two printk() statements, the call to initializeProcess() or whatever, and the infinite loop at the bottom 18:43:45 <_Quinn> teaseme, as you might expect, got stuck, presumambly in that loop 18:43:47 Ok, so there were no kernel errors there, just the inf loop? 18:43:53 <_Quinn> Correct. 18:44:14 <_Quinn> So I removed the infinite loop and started getting errors, which 18:44:26 <_Quinn> is why I asked about GC -- I thought there might be some bug 18:44:45 <_Quinn> in the 'shutdown sequence' of teaseme 18:44:50 Jewel, a misplaced spinlock could cause interrupts to be turned off, but I don't think your using any in teaseme. 18:45:14 <_Quinn> It's possible that your code triggered this bug, as well. 18:46:49 Ok, let me think a bit 18:47:11 <_Quinn> Say. You don't suppose your new code in THREAD_SynchronizeExit() might have anything to do with it? 18:47:12 With the new process support the process heap will get freed when it exits 18:48:10 Did you see a message "freeing process heap ..." 18:48:29 <_Quinn> not that I recall. I can go try again, though :) 18:51:52 I'm not sure about the locking code, it works here, but I suppose it could flare up on your machine 18:53:08 I'm busying finishing the new lock implementation in kissme 18:53:22 I'll port that over to userspace teaseme, and then to kernel space 18:53:50 The absence of locking is quite dangerous and is the reason why I stopped working on other parts of teaseme until I've finished this 18:54:19 Does userspace teaseme work for you Quinn ? 18:54:25 <-- _Quinn has quit (dallas-r.tx.us.undernet.org McLean.VA.US.Undernet.Org) 19:02:18 --> _Quinn (~tmiller@165-82-84-50.students.haverford.edu) has joined #jos 19:02:27 <_Quinn> Wow, getting back on undernet is tough. 19:02:52 Yeah, Rob and I decided to go OPN for the next meeting 19:03:01 <_Quinn> Probably a good idea :) 19:03:22 Did you see my last few lines 19:03:23 ? 19:03:26 <_Quinn> No. 19:03:28 <_Quinn> :) 19:03:35 > I'm not sure about the locking code, it works here, but I suppose it could flare up on your machine 19:03:46 > I'm busying finishing the new lock implementation in kissme 19:03:46 > I'll port that over to userspace teaseme, and then to kernel space 19:03:46 > The absence of locking is quite dangerous and is the reason why I stopped working on other parts of teaseme until I've finished this 19:03:47 > Does userspace teaseme work for you Quinn ? 19:03:53 <_Quinn> Yes. 19:04:13 What kind of code do you want to run for the console? 19:04:23 Oh yes, makeme: > I'm not sure about the locking code, it works here, but I suppose it could flare up on your machine 19:04:29 > I'm busying finishing the new lock implementation in kissme 19:04:29 > I'll port that over to userspace teaseme, and then to kernel space 19:04:29 > The absence of locking is quite dangerous and is the reason why I stopped working on other parts of teaseme until I've finished this 19:04:29 > Does userspace teaseme work for you Quinn ? 19:04:29 oops 19:04:39 <_Quinn> Have you had a chance to read that design doc I sent? 19:04:53 No I haven't yet, let me look at it quickly 19:05:06 <_Quinn> Oh, actually, this is cute. 19:05:21 <_Quinn> No, wait, it eventually came back 19:05:32 <_Quinn> user mode stalled for a while freeing the process heap 19:05:46 Stalled or waited for 10 seconds? 19:06:20 <_Quinn> I counted 22, but I'll go time 10. Hold on. 19:06:55 <_Quinn> 9.96 by my watch 19:07:25 <_Quinn> Interesting... 19:07:50 <_Quinn> why does it wait ten seconds? 19:07:59 Hehe, the main thread waits 10 seconds in the userspace version 19:08:21 Reason: In the kernel version, when the main thread exits, the module isn't destroyed, you have to do it with rmmod 19:08:43 But the linux process gets nuked when the main thread exits, so a quick hack is to sleep while the others finish 19:09:16 <_Quinn> I'm not sure I understand. 19:09:40 When a kernel thread finishes, the other kernel threads started by that module continue 19:09:45 <_Quinn> Right. 19:09:59 Not so in userspace, if the main thread finishes, the whole process is terminated 19:10:08 <_Quinn> Oh, OK. 19:10:43 <_Quinn> OK, I understand now. 19:10:46 In kissme I handle this in a much more elegant fashion, but I don't it's necessary for the userspace build (at least not yet) 19:11:53 I don't understand this paragraph: 19:11:54 Does the write-to-VGA page stuff work? Does the indicate that it 19:11:54 will be relatively straightforward to implement the memory-mapped byte 19:11:54 array and read()/write()/in()/out() functions? (That, in turn, implying 19:11:54 that the Java drivers will be ready to roll soon.) 19:12:13 What do you mean write-to-VGA page ? 19:12:22 <_Quinn> I thought you had mentioned, earlier, that you'd written something for allowing VGA drivers to work 19:12:35 <_Quinn> that is, write to the memory at 0xBh000 (or wherever) 19:12:55 What I've done is run Thomas Bocek's VGA driver on teaseme 19:13:10 it uses the jos.system.machine methods to access the VGA memory 19:13:22 <_Quinn> Which required kernel support, right? 19:13:29 <_Quinn> er, teaseme support, right? 19:13:30 (just read() and write()) 19:13:51 yes, so AFAI can see those native methods work 19:14:02 <_Quinn> I just had an idea -- what modules do you have in your kernel when you run teaseme? 19:14:27 But there is no higher-level interface for VGA 19:14:36 urm, nothing special, let me check 19:14:53 at the moment none 19:14:57 <_Quinn> Ah. 19:15:11 <_Quinn> That might be it -- I have almost a dozen 19:15:18 let's see 19:15:31 <_Quinn> Including the NVdriver module, which has always made me suspicous. 19:15:47 do you need that for text-mode? 19:15:51 <_Quinn> Nope. 19:16:16 <_Quinn> I can go drop to text mode / single user and unload all the other modules. 19:16:24 I once did an experiment with kissme where I used native methods to allow access to VGA memory, and then ran it as root 19:16:34 <_Quinn> and? 19:16:39 and also called some other unprotect message 19:16:44 to run the VGA driver 19:16:54 <_Quinn> did it work? 19:17:06 It kind of worked, but the linux consoles conflicted with it, so it was hard to say if it really worked 19:17:15 <_Quinn> Oh, right. 19:17:34 <_Quinn> You keep thinking; I'm going to go try with teaseme with a 'clean' kernel. 19:17:35 <_Quinn> BBIAB 19:17:39 <-- _Quinn has quit (Leaving) 19:17:43 Sure 19:18:57 Robert, can we write a preliminary interface for mutexes ? 19:19:18 Then I can wrap the pthread methods and later whatever approach in the linux kernel 19:20:51 It's finished already. 19:21:23 Can you send me the .h file 19:22:18 I didn't write it in assembly yet, I just used the atomic functions. 19:23:02 no problem, have you tested it? 19:24:16 --> _Quinn (~tmiller@165-82-84-50.students.haverford.edu) has joined #jos 19:24:20 Just the "the code still runs the way it did before" test. 19:24:46 ok, but the mutex code isn't used 19:24:48 <_Quinn> No luck. Just got a screen full of numbers with 'code' at the bottom 19:25:07 wow 19:25:14 Do you want the code or the headers, there is no code in the headers. 19:25:34 What are the headers? 19:25:40 Is this an oops output? 19:25:47 <_Quinn> I have no idea. 19:26:03 <_Quinn> I think the -v -m -x options to insmod produce too much output? 19:26:08 You can't get back to the cmdline, can you? 19:26:27 Think of an interface in Java, the headers only define the function prototypes. 19:26:29 Maybe, you can leave out -m 19:27:05 So that is the output from when insmod started, not from the crash? 19:27:18 <_Quinn> Huh? 19:27:27 <_Quinn> Sorry. I'm not used to kernel debugging. 19:28:01 <_Quinn> When I ran insmod, I (close enough to immediately for this mere human) got a screen full of the numbers that was probably a kernel error message 19:28:12 <_Quinn> I assumed insmod's flags could control the verbosity of said error messages 19:28:39 I think the flags only control the amount of output at the start of the insmod 19:28:50 not any later events (could be wrong though) 19:29:35 Do you think it will help if you use the same compiler I am? 19:30:42 <_Quinn> It could. How hard is installing an alternate compiler? 19:30:53 This is what insmod gives me with -m : 19:30:54 c499ab08 D tempJNIData 19:30:54 c499ab0c D uidFinalizeSigPtr 19:30:54 c499ab20 D UID_sstUidHashTable 19:30:54 c499ab60 D process_table 19:30:54 c49bab60 D nativeJNITable 19:31:00 I assume that's not what you're talking about 19:31:11 What distro are you running? 19:31:32 <_Quinn> No. I'm talking about what looks like a register dump 19:31:35 <_Quinn> Slackware 7 19:31:55 Probably the oops output 19:32:28 <_Quinn> Probably 19:32:30 I don't know what upgrading would entail on Slackware 19:32:45 The oops output has a stack trace with function names and addresses 19:33:09 Then a register dump 19:33:34 Then the actual code (hex values) that was being executed 19:33:37 You need to cut and paste that into ksymoops, but you can only do that if your machine is still usable 19:33:45 <_Quinn> Which, of course, it isn't :) 19:33:52 :-( 19:35:48 Hmm, give me a few days to implement the locking stuff and then we can start trying to discover where the problem is occurring 19:35:59 <-- _Quinn has quit (changing servers) 19:36:24 --> tmiller (~tmiller@165-82-84-50.students.haverford.edu) has joined #jos 19:36:29 nick _Quinn 19:36:31 --- tmiller is now known as _Quinn 19:36:32 <_Quinn> argh. 19:36:42 <_Quinn> did you say anything after the bit about locking? 19:37:24 no 19:37:47 <_Quinn> OK 19:38:07 Would you be interested in trying to access VGA memory from the usermode teaseme? 19:38:55 <_Quinn> Hm 19:39:13 <_Quinn> For usermode jjos, I linked to ncurses to handle to the console stuff. 19:39:30 <_Quinn> Which also made it easier to handle input 19:39:46 Ah yes, I remember 19:40:11 You can edit /etc/inittab to disable the tty for one of the VC's 19:40:58 <_Quinn> And root can than slurp control of it? 19:41:12 It wouldn't hurt if we used some of your stuff to access ncurses 19:41:38 As root you can write to video memory directly, but this is also only useful if you're telnetted in 19:41:41 <_Quinn> My plan right now is to re-implement the decaf/JJOS stuff for teaseme. 19:42:01 That would be very useful 19:42:27 <_Quinn> Since I can't get the kernel mode to run, I need to do my work on the userspace bits, so ncurses seems like a good idea. 19:42:39 <_Quinn> The big question: how does teaseme handle interrupts? 19:42:54 <_Quinn> (Equivalently, where is the scheduler, so I can make it check for them?) 19:43:44 At the moment teaseme is completely oblivious to interrupts 19:43:50 it lets linux handle everything 19:44:06 my interaction with the scheduler is minimal 19:44:24 <_Quinn> I meant teaseme's own scheduler... 19:44:32 I think in one place I change a thread's state to SLEEPING so that it can sleep, but no more than that 19:44:39 <_Quinn> ... but of course, you're using Linux threads, so you don't actually have one, do you? 19:44:45 teaseme doesn't have a scheduler, it uses native threads 19:44:50 yup 19:45:10 <_Quinn> So I'd need to generate a native thread to handle interrupts. 19:45:25 <_Quinn> How much of the JVM is accessible from one thread to the next? 19:45:41 from one kernel_thread to the next? 19:45:59 everything 19:46:01 Jewel, do you think RJK is at a stage where you can work with it? 19:46:39 I think RJK is at a stage where I can start isolating parts of teaseme and compile them with RJK 19:46:52 <_Quinn> Er... I guess so. The native code thread that responds to interrupts (or ncurses, in this case, I suppose) usually needs to do some mucking around to get the interrupt handler running 19:47:13 I think we could even do a full-blown port, but there it's more a matter of me not having the time right now as opposed to lack of functionality 19:47:27 Ok. 19:47:33 <_Quinn> which brings up a quick question: how do I give a specific thread the highest possible priority? 19:48:04 <_Quinn> For real interrupt handlers, this is very important 19:48:17 I don't know Quinn, what I think we might do: 19:48:29 Use the linux DDI to install an interrupt handler 19:48:52 Let this interrupt handler modify some structure somewhere in memory that is being watched by a Java thread 19:49:08 The Java thread pulls out the relevant data and passes it on to the Java driver 19:50:07 RobertFit: what we still need is the ability to load teaseme at run time (not compile it in), and a way to load the .class files 19:50:25 <_Quinn> Right. But the thread shouldn't be polling; it should be .wait()ing on that memory, which means that the interrupt handler will need to access that. 19:50:55 Yes, so the interrupt handler needs to directly call the Notify Object on some object 19:50:59 Shouldn't be difficult 19:51:01 <_Quinn> But the Java driver should be called ASAP after the interrupt to make sure we don't lose information on it. 19:51:35 That is the difficult part, how do we tell the linux scheduler that that specific thread must run right now 19:51:36 <_Quinn> OK. I don't know how the code is scheduled, but if you think it should be straightforward, I can probably handle it. 19:52:11 I don't think it will be too difficult 19:52:43 <_Quinn> er, not scheduled, constructed 19:52:54 <_Quinn> laid out, whatever 19:54:47 <_Quinn> BTW -- Iain is going to be nuking almost everything on jos.org, including the SourceServer; with the SourceForge CVS available, there doesn't seem to be any reason to keep it around 19:54:57 _Quinn: I don't know if you've been in touch with Robert, but he's done a whole lot of work on RJK 19:55:07 <_Quinn> hopefully by the end of the month. 19:55:14 <_Quinn> No -- does it have its own mailing list? 19:55:36 No, we were just talking about it earlier 19:55:58 It's got support for threads now, which is crucial for the way teaseme is implemented 19:56:25 <_Quinn> I'm impressed. 19:56:51 He's also implemented atomic functions for swapping ints, setting bits etc etc 19:56:58 It's not so hard when you have the Linux kerne source code near by. 19:57:04 Which means we can easily implement kernel-level locks and mutexes too 19:57:57 <_Quinn> Robert: none the less, it couldn't have been one quickly :) 19:58:07 I think the biggest thing missing (as I said earlier) is a way to get the .class files to teaseme 19:58:40 <_Quinn> Steal JJOS's zip-based-ramdisk code? 19:59:07 I know GRUB can read files off a variety of filesystems, do you think they use libraries for this? 19:59:08 Grub should be able to help with that, we can get grub to load an image somewhere. 19:59:15 (They read fat,ext2,reiser ...) 19:59:30 What does the zip based ramdisk code do? 19:59:38 Unzip an image in memory? 20:00:17 <_Quinn> No -- it reads a section of memory as an [un?]compressed zip file. You could almost call if zipfs. 20:00:48 So it transparently decompresses and looks a bit like a file system? 20:01:17 <_Quinn> I'm not sure if it decompresses or not; I'd have to check the code. I know that at one point, it did not. 20:01:35 ok, no problem, we probably won't need the decompression for a while 20:02:17 <_Quinn> Just a suggestion :) 20:03:25 Did you write that code or borrow it from somewhere else? 20:04:00 Grub can automatical unzip a module that its loads, so all you need is a filesystem or a in memory data structure that you can read. 20:04:39 <_Quinn> John Mak(???) wrote it, along with the rest of JJOS 20:05:25 <_Quinn> Fit: OK, maybe that was it. He might have been using the .zip file format as a quick and dirty filesystem, since we didn't ever want to write to it. 20:05:28 cool, so it looks that won't be too much of a problem 20:05:59 <_Quinn> Hopefully :) 20:06:12 <_Quinn> Hm... 20:07:02 <_Quinn> is antlr/DefaultToolErrorHandler in the version of antlr at the makeme site? 20:07:18 <_Quinn> actually, nevermind, I can't use .debs 20:08:40 Oh yes, let me give the URL for the makeme.tar.gz 20:10:23 <_Quinn> hm. jguru is being pissy. Will makeme work with 2.7.0? 20:11:01 don't you have antlr for the old makeme? 20:11:10 <_Quinn> yes, but I'm missing a file, apparently. 20:11:12 <_Quinn> (see above) 20:11:26 Oh 20:11:41 It might work with 2.7.0, although I've never tried 20:11:57 otherwise you can extract it from that antlr deb 20:12:04 http://download.sourceforge.net/makeme/makeme-0.01.tar.gz 20:12:32 <_Quinn> I have the new version of makeme.... 20:12:48 <_Quinn> ... now it's not finding antlr.Tool 20:12:51 <_Quinn> wtf? 20:13:12 are you compiling it? 20:13:28 <_Quinn> No. I just copied the new .jar file to where the old one was. 20:13:56 antlr has different dists 20:14:13 antlrall is usually what you want 20:15:08 <_Quinn> Doesn't seem to be there, but antlr/Tool is in the jar, according to unzip -l. Hold on. 20:16:12 <_Quinn> SOmething is really wrong here. 20:16:28 <_Quinn> I just rebuilt the jar, in case the problem was conflicting version, but it's still a no go. 20:17:21 is the .jar on your classpath? 20:18:10 <_Quinn> -classpath $CLASSPATH:../antlr.jar, yes. 20:19:24 what are you running, the makeme shell script? 20:19:36 <_Quinn> No, I edited your makefile 20:20:40 mine is: 20:20:41 CLASSPATH=/usr/share/java/repository:/usr/share/java/antlrall.jar java gnu.makeme.MakeMe $@ 20:21:29 <_Quinn> OK, now I'm back to ANTLR Parser Generator Version 2.7.1 1989-2000 jGuru.com 20:21:31 <_Quinn> java.lang.NoClassDefFoundError: antlr/DefaultToolErrorHandler 20:22:31 It sounds you are compiling makeme? 20:22:35 <_Quinn> yes. 20:22:38 sounds / sounds like 20:23:06 <_Quinn> ah. maybe the mkalljar will do the right thin 20:23:11 let me check if I have that (missing file), should I send you my .jar? 20:23:11 <_Quinn> thin / thing 20:23:56 <_Quinn> Ah, much better 20:24:00 <_Quinn> mkalljar did it. 20:24:40 That's it 20:25:49 <_Quinn> ARGH! 20:25:55 <_Quinn> Why are there still CONS! 20:26:06 Hehe 20:26:16 <_Quinn> whoops 20:26:22 <_Quinn> never mind. I goofed somethinig 20:26:26 They may still be in the source for 0.001 20:26:53 <_Quinn> Ahhh 20:26:56 <_Quinn> Finally :) 20:27:07 <_Quinn> I 'installed' makeme to the wrong directory. I' 20:27:09 <_Quinn> m happy now 20:27:31 <_Quinn> BTW, which version of jikes are you using? 20:28:32 Version 1.10 (3 Nov 99) 20:28:46 <_Quinn> OK, so at least that's the same :) 20:33:04 <_Quinn> OK, I have some other stuff to take care of. I may try to get your compiler, jewel, and work with that. ext3 is also on the list... 20:33:11 <_Quinn> ... btw, which /is/ your compiler? 20:33:44 There is a method jos.system.machine.printk, which takes a Java String 20:33:47 oops 20:33:48 bash-2.03$ gcc -v 20:33:48 Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs 20:33:48 gcc version 2.95.2 20000220 (Debian GNU/Linux) 20:34:21 <_Quinn> OK. I'll email you later this week. 20:34:26 <_Quinn> later, you two. 20:34:28 <-- _Quinn has quit (Leaving) 20:58:22 I'm going to bed soon 20:58:49 Yeah I should be heading home soon aswell. 20:59:23 I'll post whatever I've done to teaseme on the ML 20:59:40 and start doing what I can to use the kinterface 21:00:01 Ok great. I'll post a release during the week. 21:00:22 good. later. 21:00:27 Bye. 21:00:31 <-- jewel_ has quit (sleeping) **** ENDING LOGGING AT Sun Feb 4 21:09:48 2001