Showing posts with the label MIPS

A Code from the past

  I wrote this when I got interested in assembler. Pulled from old emails. # # This program takes 10 integer values from user, # inserts them into a binary tree and then prints # the tree "inorder" # # # The tree_node is like this: #   struct tree_node { #       int value; #       struct tree_node *left; #       struct tree_node *right; #    } .text #----------------------------------------------------------- # # This function prints a given node. # The nodes pointer is provided in $a0. # print_node:     subu    $sp, $sp, 32            # space on stack     sw      $ra, 28($sp)            # store the return address     sw      $fp, 24($sp)            # store the current frame pointer.     addiu    $fp, $sp, 32           # $fp to start of stack.         move    $t0, $a0                # save the nodes pointer to $t0     lw      $a0, ($t0)              # move the integer value to $a0.     jal     print_int_with_newline  # print the integer.     nop     lw      $ra, 28(

MIPS Bootstrapping

Bootstrapping is the process of taking a CPU just out of reset, fetching and executing instructions serially, to a more complex running environment. The program that does that is called a "Boot loader" or "Boot strap code" or simply "Boot code". First Instruction Fetch When power is applied to a processor and it comes out of reset, it fetches its first instruction from an address that is hardwired. This address is known as the " Boot Vector " or the " Reset Vector ". The MIPS processors' boot vector is located at physical address 0x1FC00000. The MIPS processors have MMU enabled as soon as they are powered on. The MIPS core thus presents a virtual address of 0xBFC00000. The MMU translates this address to physical address of 0x1FC00000, the boot vector. This translation again is hardwired. Typically, a boot device is present at this address and responds to the read request of the processor2. See Firgure 1.  The offset 0 of bootstr

What is X-Visor?

X-Visor aims towards providing an open source virtualization solution, which is light-weight, portable, and flexible. It tries to ensure small memory foot print and less virtualization overhead in every functionality. Open source projects such as: Linux, NetBSD, FreeBSD, and QEMU have made a great impact in Xvisor design & development. X-Visor has most of the features expected from a modern full-fledged hypervisor, such as: Tree based Configuration (Device Tree) CPU virtualization (Guest, Virtual CPUs, Virtual IRQs) MMU virtualization (Virtual MMU, Virtual Guest Address Space) IO virtualization (Device Emulation Framework, Emulators) Device Driver Framework (Host Address Space, Host IRQs, Drivers) Threading Framework (Hypervisor Threads) Managment Terminal (Mterm) Serial Port Virtualization (Virtual Serial) Xvisor is a highly portable source code. In fact, its development was initiated in 3 different architectures (ARM, MIPS and Intel 64) simultaneously, to ensure flexi