About leJOS firmware

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

About leJOS firmware

Postby the_guy » Sun May 13, 2007 11:45 am

Hi all!

I'm doing a school project, where I have to write as much information as I can find about NXT firmware (or opreating system) or its alternatives. One of them is of course leJOS.

I need information:
- how leJOS manages threads (and processes)
- what kind of CPU scheduling does it have
- how does it synchronize processes
- how does handle deadlocks
- how does manages with memory
- about virtual memory support
- file system support


I have found some information related to TinyVM, but I'm not sure how smart is to use that for leJOS.

Any help will be appreciated...
the_guy
New User
 
Posts: 2
Joined: Sun May 13, 2007 11:26 am

Postby lawrie » Sun May 13, 2007 1:07 pm

Some quick replies:

- how leJOS manages threads (and processes)

lejos does not have processes - just Java Threads.

- what kind of CPU scheduling does it have

A timer interrupt generates a "tick" every millisecond. The Java VM interpreter main loop switches threads when a thread waits for an event, sleeps or yields, or after a configurable number of ticks. The number of ticks that generates a pre-emptive thread switch is set to 20 for the RCX, and 2 for the NXT.

- how does it synchronize processes

There are no processes. Java language constructs including monitors and synchronized methods are used to synchronize threads.

- how does handle deadlocks

I don't think the VM has deadlock detection - it is up to the developer to avoid deadlocks.

- how does manages with memory

The Java heap is one contiguous chunk of memory that is used for allocation of Java objects. The Java stack grows dynamically and uses the same memory region as the heap.

The VM native (C) code has a fixed size stack and no dynamic memory.

- about virtual memory support

There is no virtual memory.

- file system support

The current development version of lejos has a simple file system in flash memory, implemented by the Java File classs.
lawrie
leJOS Team Member
 
Posts: 922
Joined: Mon Feb 05, 2007 1:27 pm

Postby the_guy » Sun May 13, 2007 6:24 pm

Thanks a lot for posted information.

I found some information about tinyVM. If leJOS is derived from tinyVM, can I use information about Memory Management, Objects, Multi-Threading and Synchronization for leJOS conclusion?

So synchronization between threads is depended on developers (programmers)? They synchronize threads with word synchronize just like in other Java applications/programs? Is my understanding right?

PS: How do you know so much about leJOS? Is there some book or internet link about it?

PS2: How much leJOS RCX and leJOS NXJ differ from each other?
the_guy
New User
 
Posts: 2
Joined: Sun May 13, 2007 11:26 am

Postby lawrie » Wed May 16, 2007 9:58 am

leJOS is derived from TinyVM, and a lot of the memory management and thread implementation are the same. However, things have moved on since TinyVM, and some memory management is different - e.g. dynamic stacks have been added.

Yes, you use the Java synchronized keyword.

I know about leJOS as I am currently the main developer on leJOS NXJ, and I read the code. There are a couple of books with chapters about the leJOS VM, e.g. Brian Bagnall's first book, Core Lego Mindstorms Programming, and also Programming Lego Mindstorms with Java, which Juergen Stuber contributed to.

The best experts on the areas that you are talking about are Juergen Stuber, Paul Andrews and the original developer of TinyVM and lejos - Jose Solorzano, but they are not currently active on the project.

The Java VM used by lejos NXJ is basically the same as for the RCX, but all the device driving (LCD, Sensors, Motors, USB, Bluetooth, Sound, etc.) is new. The 256kb of flash memory on the NXT means that we have been able to add a file system. The way of uploading, storing and running programs on the NXT is all different.
lawrie
leJOS Team Member
 
Posts: 922
Joined: Mon Feb 05, 2007 1:27 pm


Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

more stuff