BrickOS Task and Memory Monitor - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

BrickOS Task and Memory Monitor

Description:

Java web applet using Swing components to build a GUI. ... the amount of memory used and free, and the number of task currently running on the system. ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 18
Provided by: charlesma
Category:

less

Transcript and Presenter's Notes

Title: BrickOS Task and Memory Monitor


1
BrickOS Task and Memory Monitor
  • Charles Mancinelli
  • CMPS 490
  • Advisor Dr. Bi

2
Review
  • Constructing a monitor for the BrickOS.
  • Java web applet using Swing components to build a
    GUI.
  • Applet will monitor task/threads and the
    allocation in memory of those tasks.
  • Information is sent from the RCX and received by
    PC by a USB infrared tower.
  • LegOS Networking Protocol (LNP) to send
    addressing packets of data from the RCX.
  • LNP is supported is implemented in Java by
    josx.rcxcomm package and also interfaces with USB.

3
Overview of Presentation
  • Representation
  • Protocol
  • Structure of Data Packets
  • Data Structure
  • Interface Design
  • Architecture Design
  • GUI Example
  • Modifying the BrickOS

4
Representation
  • Integers only will be sent and received as
    packets.
  • Java and C/C represent integers in four bytes.
  • BrickOS integers are two bytes.
  • (28)(28) 65536 words.
  • Range of -32768 to 32767 signed.
  • Shorten the representation to include a range of
    only positive integers.
  • Range of 0 to 65535 unsigned which is the range
    of the memory layout of the RCX.

5
Josx.rcxcomm Protocol
  • Currently only supports sending a two byte buffer
    for addressing and integrity layers.
  • Initial plan was to send an entire packet of
    integers associated with each process.
  • Maximum size any packet can be is 255 bytes on
    both RCX and PC, Ive heard on 64 bytes can be
    sent reliably.
  • Additional plan to modify the protocol to send
    packets of up to 255 bytes if there is time.
  • Inherits the Javas input and output streams.

6
Sending and Receiving Packets. RCX?PC
  • RCX C program
  • An array is initialized with two elements of type
    unsigned char. Each of which represent one byte.
  • The unsigned integer is divide by 256 and placed
    in the 0 element of the array giving the higher
    order byte.
  • It is then divided mod by 256 and placed in the
    1st element of the array giving the lower order
    byte.
  • A system call is made to lnp_addressing_write.
  • Java PC side
  • A new instance of RCXLNPAddressingPort is
    initialized along with input stream and
    DataInputStream.
  • An integer can then be read as a character
    because its 2 bytes.

7
LNP Addressing Packets
  • ----------------------------------------- 
    F1LENDESTSRC   ADATA      CHK 
    ----------------------------------------- 
                                
            lt-      IDATA        -gt
     
  • F1    identifies an addressing packet 
    LEN   length of IDATA section ( 1 to 255
    bytes )  DEST  destination address  SRC  
    source address  ADATA payload data (1 to
    253 bytes)  .
  • The Addressing packet is all set up by a simple
    system call.
  • lnp_addressing_write(buffer, length, dest, recv)

8
My Protocol
  • How do you distinguish what type of data you are
    receiving on the PC if your getting a series of
    integers in a data stream?
  • When the receiving module gets two negative
    integers it knows what type of packet it
    receives.
  • -1 represents a task data.
  • -2 represents memory data.
  • -3 represents system information .

9
What information will be displayed?
  • Systems information which will include the
    version of the BrickOS running, the amount of
    memory used and free, and the number of task
    currently running on the system.
  • Information for each task will include its
    priority, state, kernel/user, tid, pid, and the
    queue header.
  • A layout of memory and where each task is
    displayed.

10
Data Structure
  • All packets of data received will be put into a
    doubly linked list.
  • Three separate lists will be constructed for each
    type of data. Systems, memory or task data.
  • Each packet of data will be stored as object of
    type memPacket, tcbPacket and sysPacket. Then it
    will be inserted into the appropriate list.

11
Interface Design
  • The Java look and feel will be used from Swing
    because it is compatible across all platforms.
  • Functions and looks similar to the Task manger in
    Windows 98, 2000 or XP.
  • Will contain a menu bar with file, control and
    help pull down menus.
  • Three tabs where the information will be
    displayed called, System, Tasks and Memory Map.

12
Architecture Design
  • Architecture Diagram
  • GUI Example

13
Task Information
14
Memory Information
15
Modifying the BrickOS
  • Modify the LNP to add the additional protocol I
    created for packets.
  • When a task is run by the scheduler the
    information will be inserted into a packet. When
    the packet is full it will be sent using LNP.
    tm.c
  • Modify mm.c to include a memory scan function
    that will give us the entire memory layout.

16
Current Problems
  • IR towers transmission might not be fast enough
    for it to operate in real time.
  • Applets have to have special permission to read
    or write to files on an OS.
  • The jos.rcxcomm package requires an operating
    systems dependant file. For Windows it requires
    irtower.dll.

17
Any Questions, Comments or suggestions?
Write a Comment
User Comments (0)
About PowerShow.com