Monday, June 27, 2005

Minor improvements

I have started reading the CSP book. In summary it covers a mathematical description of processes and interaction of processes. There are also extension papers/books to it; one of them adding a timing factor, and the other a priority factor. There's also the occam language that implements the CSP model, it is said to be similar to handel-C. Hopefully I will finish reading it soon, and understand concurrency better.

I am also reading Advanced Programming in the Unix Environment. Because I am already familiar with many of the concepts, and it would make sense to skip definitions of syscalls like setuid(), mkdir() etc. I'm almost in the middle now. I need to read more on process interaction/shared memory, which shouldn't be difficult. Then I'm gonna look at L4 IPC implementation.

I have also thought of a way to install an IRQ handler in a one-liner, simply store the already-encoded MOV PC [r0] instruction in 0x18, where r0 contains some address into which you also store a pointer to your handler function. I just learned if you do a cast like (unsigned int) func_name, you get the address of the function. It makes sense, but I didn't think you could do that for a function symbol. Also this would work only for the simplest cases (not for an OS) since for a global handler, you would want your interrupt handler text be seperately copied to some location in low-memory. This is because otherwise your interrupt handler would come embedded within the single application that you load. You wouldn't have a global interrupt handler for multiple tasks.

I'll see how Unix and CSP goes, and then get back to L4, interrupts, assembler etc.

Sunday, June 05, 2005

Along came Tarik

Tarik came to visit this weekend, so I didn't do any work. He did give me a long time on my own, though. He re-assured that he still has his amazing sleeping habit. He slept at around 7PM, which made me sleepy, I also had a nap for an hour. After that I woke up for a while, had a phone call, then I woke him up around 9PM, because he wouldn't be able to sleep during the night, if he would continue. But, that wasn't the case, he insisted on sleeping, which I had nothing to say. So he went on a deep sleep again, during which I read a few papers on RTR. A company has actually made a reconfigurable computing hardware for which you can design C and a HW language co-design - which isn't that much of a suprising technology nowadays, but interesting things is they acquired a patent for it such that no-one can use a similar approach, and accelerate web server operations using a reconfigurable hardware architecture similar to theirs.

Anyways, I went to sleep around 00:30 AM. Then me and Tarik both woke up 11:30AM in the morning. So he basically slept for 11:30 + 12-7 = 16,5 hours! He just did it again. But he hadn't slept for the last couple of days I think.

Secondly I just learned that I should assemble my binary carefully because elf-to-binary conversion is a rough and tough one. I was expecting that all services an elf-loader provides such as zeroing out the .bss, loading sections into various addresses etc. would be lost as you have nothing but a raw binary file. I confirmed this is true. It's unlikely your binary would work because all relocation etc. is just lost when you convert. So what I need to do is write my own routines to copy .text into various places, use PIC as much as possible in code that scatter-loads, and relocate global references in my own code. I have absolutely no experience in this but after I learn how to, it shouldn't be too hard.

Saturday, June 04, 2005

USB 2.0 almost there

Today I've almost cracked how the stack works - only for the control transfers though. But thats not too bad. Next, I'll get to know how the received data is formed in the QTD.

I'll also get back to the SLOS stuff soon. eCos vector.S is quite useful by the way.