Archive for the ‘Major Project’ Category

I’ve Finally Started!

Tuesday, July 7th, 2009

At last! I’ve finally started doing some work on my major project. I’ve spent a brief amount of time yesterday getting my new Trac installation working. You can get to the Trac install here, and unlike last time everything is restricted to read-only for various reasons:

  • It’s supposed to all be my own work!
  • Last time I put a link to a Trac install I got thousands of tickets which suggested I buy Viagra.

Anyway, having installed Trac I then set about creating some components, milestones, versions etc. I also started writing some documentation about the OS, the coding standards to be used, the goals, and all that sort of stuff. As I figure out more completely the requirements of the project the Wiki will be improved with more information and documentation. My hope is that when it comes to the final report I’ll be able to grab a lot of the stuff off the Wiki.

You may be thinking to yourself - this is all well and good, but this isn’t actually a start - it’s just a “time wasting exercise to make you think you’ve started.” But this is where you’d be wrong. In addition to all the above I created the first ticket - the boot loader task, and then promptly proceeded to write the boot loader. Although I’ve not tested it yet, it’s so simple stuff I don’t have any concerns. Obviously that won’t do when it comes to writing my report and all that palava - so I will have to come up with a way of testing a boot loader, but for the moment I’m just assuming it will work - it compiles.

As with MouthOS, the boot loader for my project uses GRUB, but this time it makes much more effort to use the features provided, such as GRUB’s own memory map etc. This is actually a very simple task:

kernel:

extern main

; Push the address of the GRUB memory info onto the stack so that
; the kernel can get to them.
push eax;
push ebx;

; Call the main kernel. Notice that we should NEVER EVER return
; from main, but if we do we end up in an infinite loop. At
; some point (once system calls are working) that should change
; to panic!
call main
jmp $

Easy eh? Well, there is actually a little more code than that in order to setup a basic 8K stack, BSS etc. However, that is the gist of the boot loader! You’ve gotta love GRUB. Obviously there are a number of things that still need doing such as enabling interrupts, setting up the Global Descriptor Table and Local Descriptor Tables etc. These are things that GRUB does, but only to a very simple extent - for example, as my comments in the code say:


; cs  = A read/execute segment, offset: 0, limit: 0xFFFFFFFF (32 bit)
;
; ds, es, fs, gs, ss
; A read/write segment, offset 0, limit: 0xFFFFFFFF (32 bit)

You can very quickly see that the entire of the memory is read/write/execute - no matter if it is a stack, code segment, data segment etc. In other words GRUB would seem to be pretty lazy in this regard. But I suppose that is because no matter what you’re going to want to change it anyway. So my next task really is to write the rest of the boot loader including the code to sort out the GDT and LDTs. Oh, and I’ve added about 25 tickets now of things that I need to do for the first release of the project. Looks like I’ve got a lot of work to be doing.

So, apart from my progress with the major project, what else have I been doing? I’ve started going swimming and last Thursday I managed to do 90 lengths (approximately two a half Km) - perhaps not fantastic for some, and a real shame that it’s not 100, but for me that is pretty good going. Today I also managed to re-create this achievement. Hopefully next time I’ll manage the 100 - but by 90 I’m exhausted!

So right now I’m off to get a cup of coffee and then I’m going to watch the latest episode of Tourchwood on iplayer, and then tomorrow I’ve got guitar lesson :)

And off we go…

Friday, June 5th, 2009

So, it has nearly been a year since my last post - so much for the ‘my new Sun blog doesn’t mean I won’t be posting here’. Not very much has really happened during the year. A lot of course work for university and generally just work for Sun managing the Campus Ambassadors in the UK. However, my exams are all finished and the summer holidays have begun!

So, as I approach my final year at Aberystwyth University (those last 4 years have gone pretty fast) I reach the important decision as to what I should do for my final year project. This project is a Masters level 60 credit module. As each year is 120 credits, that is half of the whole year. As you can imagine, the project has a major effect on the final mark I will get for my degree. So, it’s a big decision to make.

Those of you who are (or at least, were) avid readers of this blog would probably jump to suggest that I would be doing MouthOS for my final year project. You would be half correct. After much thought and investigation I have decided to produce a real-time operating system kernel for a chip known as the Propeller. It is a fantastic 32bit micro-controller produced by Parallax and has 8 cores (each core is 10MHz) and a whopping 32KBs of RAM. You can read all about the chip here. As far as I have been able to ascertain so far there is no Operating System as such for this chip at the moment, and so this is a perfect option for a masters level project - it has to provide something unique or some slant that makes the project worth while.

I decided some time ago that it would be a good idea to blog about the progress of my project - both so I have a record for when it comes to writing my dissertation, and for others who are interested in such things. It is for this reason that I am writing this post which I hope will be the first of many more.

Now that it is the summer holidays my first task is to start reading some books on the subject of real-time systems and the like, not to mention continued reading and research into Operating Systems and Kernels. As such I’ve been to the university library and got myself quite a little collection of books to read:

This is not to mention the books I already have on Linux, Solaris etc. Further the next few weeks will be spent reading and playing around with existing real-time operating systems. Things like RTOS come to mind. After that my next task is to familuarise myself more with the Propeller chip. I currently have the use of a integrated Propeller solution, designed for writing games, called the ‘Hydra‘. It is my aim to use this as the base for the development work and testing as it is known to work so there (hopefully) won’t be any hardware issues to slow the progress or cause trouble. However, we all know there will be!

So, what else have I got to do during the holidays? I have agreed with one lecturer to run a couple of lectures next year. As such I will be giving three lectures for the CS101 module (Introduction to Computer Hardware and Software). Specifically my three lectures will cover two topics: ‘File Systems’ and ‘Processes and Threads’. So, at some point I need to write the slides for that too as the current slides are out of date and don’t go in as much depth as I want to. On the file system side the slides currently cover things such as what file systems are out there and what they do, but not really how they do it. My aim is to bring a bit more of the gritty detail into the lectures - so we’ll be covering things such as LBA (logical block addressing) and how it relates to CHS (cylinder, head, sector) etc, as well as how inodes come into play in Linux and UNIX variants etc. I’m also hoping to bring the slides up to date so we cover thing such as ZFS and etx4. As far as Processes and Threads go I hope to bring more detail as to what the differences really mean - i.e. that processes have their own address spaces whilst threads (or perhaps LWPs - depending on the OS you’re using etc)  are generally ‘light-weight’ that is they share a processes address space etc. I also want to bring into this the idea of how scheduling works, and explain what is really involved in a task switch on a processor (the storing of the stack, the changing of the program counter etc etc). This kind of information is not covered in much depth at the moment. At the same time I’ve got to keep it to a level that 1st year computer science students will be able to cope with (but still tax them a bit), and obviously a whole course could be taken on one of these subjects alone, so three lectures isn’t very much time!

So, as if this isn’t enough already we’re also moving on the 11th July. This means copious amounts of packing and indeed also the wiring of the ‘new house’ with network, phone, TV etc.  Then to top it all off, I’m still working for Sun (soon to be Oracle) and right now that means recruiting ambassadors and working out what the ambassador program will be all about in September. So, all in all, a pretty busy summer. I think the main thing to gather from all this is that I will now (hopefully) be blogging more regularly about the progress of my final year project.

So, until my next update.