Porting uclinux to MIPS

Size: px
Start display at page:

Download "Porting uclinux to MIPS"

Transcription

1 Porting uclinux to MIPS This document describes how to porting uclinux to MIPS platform. And also describes how to porting GNU toolchain and uclibc on that platform. The last version of this document can always be found at 1.About this document 1.1 What this document tells and doesn t tell 1.2 Copyright notice 1.3 The last version of this document 2. General information of uclinux 2.1 Introduction of uclinux 2.2 How about the GNU toolchain and c lib 3. MIPS 3.1 Introduction of MIPS 3.2 MIPS without MMU 4. Porting uclinux 4.1 uclinux kernel structure 4.2 Kernel mode and user mode check 4.3 Memory accessing check 4.4 Fork and Vfork 4.5 binfmt_flat.c 4.6 Reserve instruction and linux 4.7 Memory page fault handle 5. Porting GNU toolchain 5.1 GNU toolchain and uclinux 5.2 Porting ELF2FLT 5.3 Reserve instructions and toolchain 5.4 Soft floating 6. Porting uclibc 6.1 Introduction of uclibc 6.2 Stack align to 8 bytes 6.3 Pthread 6.4 float-point instruction 7. JIT Simulator 7.1 Introduction 7.2 How to use it? 7.3 Where can I get it?

2 8. Other issue 8.1 Share lib on uclinux 8.2 PIC or NO-PIC? 9. Get and build packages 1.About this document 1.1 What this document tells and doesn t tell This document descript how to porting uclinux, uclibc and GNU toolchain to MIPS platform. And it tells people where to get the patches and tools. We didn t list every place we modify in the original code, because reader can see all the changes in our patch file. Also this document doesn t give details about MIPS and uclinux. We assume the readers have already known about these. We will use the special version of hardware MIPSR3000 as samples. Hope this document helps. 1.2 Copyright notice Copyright (c) Qiu Liming (qiulm@xiptech.com ) Chang Xinlin (zxl@xiptech.com) Xipos Tech. ( ) Personal user can get and read this document freely. Please don t use it in business without the permit. 1.3 The last version of this document 2. General information of uclinux 2.1 Introduction of uclinux uclinux is the most popular OS used in no MMU device. Though uclinux works the same with linux in many ways, they have some differences, such as fork, mmap, stack size, memory fragment. We should pay attention to these problems when we porting AP from linux to uclinux. However, uclinux is still one of the best choice in no MMU system.

3 The newest version of uclinux kernel can be obtained at The official release supports two platform, arm and m68k. uclinux has been ported to many other platforms. As we know, MIPS version of uclinux 2.4.1x is done by some companies. But there is no patch is published. We do the porting job and now release it to the public. 2.2 How about the GNU toolchain and uclibc uclibc is the standard C lib for uclinux. It supports MIPS already. But to MIPSR3000, there are some place had to be changed. GNU toolchain can be used to build linux or uclinux, no matter kernel and AP. But a tool named elf2flt, which is used to generate the flat format file for uclinux, need to be added to toolchain. The original version of elf2flt doesn t support MIPS. 3. MIPS 3.1 Introduction of MIPS We can get all information about MIPS at Here we only list some features of MIPS, TLB can be seen by software Delay slot Access unaligned address will cause exception Div zero will NOT cause exception 3.2 MIPS without MMU Figure 1

4 Figure 1 is the memory mapping between virtual address and physical address of no MMU version MIPS. Only kuseg can be accessed by user mode program. When the physical RAM is located at 0x , some thing special will happen. No user mode program can run because they cannot access any RAM! Unfortunately many devices arrange their RAM to 0x We must solve this problem. Later section you will see how. 4. Porting uclinux 4.1 uclinux kernel structure This section descript the structure of uclinux kernel. Uclinux kernel can be generated as following, 1. Get linux kernel source code 2. Get the corresponding uclinux patch 3. Patch it to linux source code tree, then we get uclinux kernel There are 5 directories are added into the linux tree mmnommu arch/armnommu arch/m68knommu include/asm-armnommu include/asm-m68knommu For supporting flat file format, fs/binfmt_flat.c is also added. To start our tour of porting uclinux to MIPS, let s copy include/asm -mips to include/asm-mips, and then copy arch/mips to arch/mipsnommu. After these steps, change the Makefile to disable arch/mips and enable arch/mipsnommu. 4.2 Kernel mode and user mode In uclinux/linux, OS kernel run in kernel mode, AP and lib run in user mode. But as we discuss in section 3.2, user mode program cannot be executed on some platforms. What can we do to let uclinux run on them? Our solution is maintain MIPS CPU running at kernel mode, and cheats the uclinux kernel when it tries to do the switch between user mode and kernel mode. The first step is change start_thread (include/asm-mipsnommu/processor.h) #define start_thread(regs, new_pc, new_sp) do { \ /* New thread loses kernel and FPU privileges. */ \ regs->cp0_status = (regs->cp0_status & ~(ST0_CU0 ST0_KSU ST0_CU1));\ regs->cp0_status = (regs->cp0_status & ~(ST0_CU0 ST0_KSU ST0_CU1)) KU_USER;\ regs->cp0_epc = new_pc; \ regs->regs[29] = new_sp; \ current->thread.current_ds = USER_DS; \ } while (0)

5 This macro will be executed when kernel creates user mode program. It will set KU_USER bit to force MIPS CPU into user mode. Once we remoce this bit, MIPS CPU won t go into user mode anymore. The second step is to cheat uclinux. When exception happens, uclinux check if it is running at user mode. If the answer is yes, the stack needs to be switched to kernel mode stack. After exception is handled, uclinux check this again to decide if the stack needs to be switched back. MIPS linux uses two methods to do the check, bit CU0 of CP0_STATUS and bit KU_USER of CP0_STATUS. We cannot use KU_USER in our uclinux. Then we use CU0 for all checks. This step will change the following files, arch/mipsnommu/kernel/entry.s arch/mipsnommu/kernel/scall_o32.s include/arch/mipnommu/stackframe.h include/arch/mipsnommu/ptrace.h At the last of this section, we will discuss about scall_o32.s. This file handles system call. When system call is done, the CPU should return to the place where the call is made. But if the call is come from user mode, signal and schedule will be handled first. Code in scall_o32.s works fine when the call is really come from user mode. The problem is there is no check here, if the call is come from kernel mode, will this code work fine too? 4.3 Memory accessing check To enhance the security of linux, kernel will check if a pointer is legal before using it. Because it s hard to distinguish kernel mode address and user mode address in MIPS uclinux., the memory check should be removed. At first we need to change access_ok (include/asm-mipsnommu/uaccess.h), most memory check is accomplished by it. Then we need to modify some functions written in assembly, such as strncpy_from_user_asm. These functions will do the pointer check by itself. 4.4 Fork and vfork Uclinux doesn t support fork, it only supports vfork. To avoid user mode program call fork, we should change sys_fork in MIPS uclinux. We just need to change the parameters sys_fork pass to do_fork, let sys_fork work as vfork. 4.5 binfmt_flat.c

6 This file handles the flat format for uclinux. It only supports arm and m68k. We will make it support MIPS as well. Details is discuss in Reserve instruction and linux MIPS I has some instructions to handle unaligned address access. (lwl/lwr,swl/swr) But they are not implemented in every MIPS CPU product. Such CPU will cause a Reserve Instruction exception when executing them. The normal way to solve this is handle them in do_ri. But this is not the best way because it slows down the system. In function memcpy will use these instructions, imaging what will happen when you do memory copy. We must remove these legal but not implemented instructions from our MIPS uclinux. Gcc will emit these instructions too. We had better to modify Gcc to avoid this problem. 4.7 Memory page fault handle When page fault happens, linux will try to find out the corresponding VMA. And then try to fix up the fault. This is not be necessary in uclinux. Therefore the code handle page fault can be removed. 5. Porting GNU toolchain 5.1 GNU toolchain and uclinux As we discuss before, GNU toolchain can be used to develop MIPS uclinux kernel and AP. The only thing we need to do is porting elf2flt. Thanks for the great job done by Erik Andersen (andersen@uclibc.org), we can donwload, config, compile and install GNU toolchain easily. And his job is the base of ours. 5.2 Porting ELF2FLT GNU toolchain doesn t support flat format. Ld will generate ELF format file, and then use elf2flt to convert it to flat file. Now we introduce the flat format in brief. A flat file has 5 parts, they are file header, text section, data section, bss section and relocate table. The file header includes the sizes and offsets of other parts, also includes the entry point and characteristics of the file. The relocate table includes a got table and some other relocate items. The got table is located at the beginning of data section, end ends with a dword 1. After install elf2flt, a script file ld-elf2flt takes the place of the original ld, the old ld is renamed to mipsel-uclibc-ld.real. To create a flat file, we need to do like this, mipsel-uclibc-gcc Wl,-elf2flt foo.c o foo

7 Gcc will call ld (in fact it calls ld-elf2flt) to link after compile foo.c. And ld-elf2flt will call the old ld twice to create two ELF files, foo.elf and foo.gdb. foo.elf is an object file, includes reloc section. foo.gdb is executable file, includes got table. ld-elf2flt then call elf2flt, uses foo.elf and foo.gdb as input. Elf2flt uses information from these two ELF file to create relocate table. We must notice that the memory map of two ELF file is not the same, because of the existing of got table. Elf2flt will calculate the got table size. The original version of elf2flt assumes every data section in object file align at 4 bytes. This condition can not be guaranteed in MIPS object file. We have fixed it. Elf2flt uses elf2flt.ld as ld script. Base address of the whole module is set to 0 in elf2flt.ld. It cause got table contains some zero value item. binfmt_flat.c won t handle these items because it need to support c++ programs. We change the base address to 0x40000 and solve this problem. 5.3 Reserve instructions and toolchain As we descript in 4.6, sometimes GNU toolchain need to be modified to avoid emitting some instructions. How to do this is a large issue, we won t talk about it in this document. The paper GNU Compiler Collection (GCC) Internals will be a good reference for doing this job. If you only want to remove unaligned memory access instructions, you can change tc-mips.c in GAS. But you had best to change gcc to generate more efficient code. 5.4 Soft floating gcc supports soft-floating. You only need to add msoft-float to your Makefile. 6. Porting uclibc 6.1 Introduction of uclibc uclibc can work on MIPS platform without many porting job. Though we still have some thing to do. 6.2 Stack align to 8 bytes The MIPS version gcc has a macro va_arg, just like other versions. The stack pointer need to be aligned at 8 bytes when use this macro in MIPS. It will cause error when the macro handles 8 bytes long parameter otherwise. We make the stack pointer align to 8 bytes in uclibc startup code. 6.3 Pthread Pthread code in uclibc use MIPS II instruction in function testandset. If the CPU only supports MIPS I, we should remove them. We use sysmips(mips_atomic_set ) instead of the MIPS

8 II instructions. 6.4 float-point instruction MIPS version uclibc will save and restore floating-point registers in setjmp and longjmp. We must remove the code if the CPU has no floating-point processor. (see libc/linux/mips/ longjmp.c and libc/linux/mips/setjmp_aux.c ) 7. JIT Simulator 7.1 Introduction The best way to be a expert of porting uclinux to MIPS is to do all porting job by yourself. But every one cannot get a MIPS hardware. Even you have one, it s wasting tim e to download and write the code to flash rom. We would like to introduce our Xiptech Simulator for MIPS to you. It is an instruction set system level simulator. It emulates a MIPSR3000 CPU and some virtual devices. It can run MIPS binary code directly, including linux/uclinux kernel, libs and applications. The main feature of our simulator is its world leading performance. It uses a just in time compile engine and can run faster than 50 mips on a P3 650 notebook. We offer a demo version to personal users. This version doesn t contain some advance functions, but it s enough to learn how to porting linux/uclinux/libs/gui/application/gdb to MIPS platform. Please don t use it in business without permit. 7.2 How to use it? The demo version simulator runs on MS Windows 98/Me/2000/XP. If you need linux version please contact us. A user guide document is included in the package. In fact, using simulator just like use the hardware. You need to build an OS kernel image and give it to the simulator. Then simulator will boot and run your kernel. Our patch file for MIPS uclinux contains all drivers for simulator. You can find them in arch/mipnommu/mach-xipos. 7.3 Where can I get it? 8. Other issue 8.1 Share lib on uclinux Modern OS provide share lib or DLL. Some DLL systems don t support process independent data section, such as MS Win3.1. Some others do, such as linux. In no MMU systems, it s not easy to

9 provide the second type of DLL. Therefore normal linux share libs cannot be used in uclinux. As we know, some companies have expanded uclinux to support share lib under arm and m68k platform. We do the same job on MIPS platform. But the code is under testing, we will release it in next version. 8.2 PIC or NO-PIC? Linux uses PIC code in its share lib and applications. In uclinux we have choices, PIC or NO-PIC? Based on our testing, NO-PIC code run faster than PIC code. (About 30%) Using NO-PIC will improve the system s performance. But NO -PIC code will cause two problems, much bigger executable file size and more time to load the program. You can make decision based on your situation. By the way, to use NO-PIC code, some reloc types, such as REL_HI16, should be handled in elf2flt. 9. Get and build packages Build toolchain At first you MUST connect to Internet when you build the toolchain. Download toolchain.tar.gz from then unzip it and make. All the source code of toolchain will be download and config automatically. The toolchain will be installed to /opt/toolcahin by default. Before you use it, You need to export PATH=/opt/toolchain/bin:$PATH If you want to change the install path, you need to change TARGET_PATH in Makefile before you make. Maybe you need to modify uclibc for your platform, please do it after the make process. Do your change and then make uclibc This operation will rebuild and install the uclibc. toolchain.tar.gz comes from Erik Andersen. We just do a little change and use our elf2flt for MIPS. More information and the newest version of this package can be get on Build uclinux Dowdload the following files,

10 Unzip and patch, mkdir mips-uclinux cd mips-uclinux bunzip2 <../linux tar.gz2 tar xvf - gunzip../uclinux uc1.diff.gz gunzip../uclinux uc1-mips.diff.gz tar zxvf../romfs.tar.gz cd linux patch -p1 <../uclinux uc1.diff patch -p1 <../uclinux uc1-mips.diff Build kernel make mrproper cp xipos.config.config make menuconfig make dep make The file uclinux.bin will be created, and then use our Xiptech simulator for MIPS to run it.

ECE 598 Advanced Operating Systems Lecture 11

ECE 598 Advanced Operating Systems Lecture 11 ECE 598 Advanced Operating Systems Lecture 11 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 23 February 2016 Announcements Homework #5 Posted Some notes, discovered the hard

More information

Introduction to RISC-V

Introduction to RISC-V Introduction to RISC-V Jielun Tan, James Connolly February, 2019 Overview What is RISC-V Why RISC-V ISA overview Software environment Beta testing What is RISC-V RISC-V (pronounced risk-five ) is an open,

More information

ECE 598 Advanced Operating Systems Lecture 10

ECE 598 Advanced Operating Systems Lecture 10 ECE 598 Advanced Operating Systems Lecture 10 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 22 February 2018 Announcements Homework #5 will be posted 1 Blocking vs Nonblocking

More information

Greg Ungerer

Greg Ungerer uclinux State of the Nation Presented by Greg Ungerer SnapGear A division of Secure Computing Corp 825 Stanley St., Woolloongabba QLD. 4102. Australia PH: +61 7 3435 2888 www.snapgear.com

More information

Cross Compiling. Real Time Operating Systems and Middleware. Luca Abeni

Cross Compiling. Real Time Operating Systems and Middleware. Luca Abeni Cross Compiling Real Time Operating Systems and Middleware Luca Abeni luca.abeni@unitn.it The Kernel Kernel OS component interacting with hardware Runs in privileged mode (Kernel Space KS) User Level Kernel

More information

Embedded Systems Programming

Embedded Systems Programming Embedded Systems Programming OS Linux - Toolchain Iwona Kochańska Gdansk University of Technology Embedded software Toolchain compiler and tools for hardwaredependent software developement Bootloader initializes

More information

ECE 498 Linux Assembly Language Lecture 1

ECE 498 Linux Assembly Language Lecture 1 ECE 498 Linux Assembly Language Lecture 1 Vince Weaver http://www.eece.maine.edu/ vweaver vincent.weaver@maine.edu 13 November 2012 Assembly Language: What s it good for? Understanding at a low-level what

More information

UFCETW-20-2 Examination Answer all questions in Section A (60 marks) and 2 questions from Section B (40 marks)

UFCETW-20-2 Examination Answer all questions in Section A (60 marks) and 2 questions from Section B (40 marks) Embedded Systems Programming Exam 20010-11 Answer all questions in Section A (60 marks) and 2 questions from Section B (40 marks) Section A answer all questions (60%) A1 Embedded Systems: ARM Appendix

More information

Debugging uclinux on Coldfire

Debugging uclinux on Coldfire Debugging uclinux on Coldfire By David Braendler davidb@emsea-systems.com What is uclinux? uclinux is a version of Linux for CPUs without virtual memory or an MMU (Memory Management Unit) and is typically

More information

PROCESS VIRTUAL MEMORY PART 2. CS124 Operating Systems Winter , Lecture 19

PROCESS VIRTUAL MEMORY PART 2. CS124 Operating Systems Winter , Lecture 19 PROCESS VIRTUAL MEMORY PART 2 CS24 Operating Systems Winter 25-26, Lecture 9 2 Virtual Memory Abstraction Last time, officially introduced concept of virtual memory Programs use virtual addresses to refer

More information

Porting Linux to x86-64

Porting Linux to x86-64 Porting Linux to x86-64 Andi Kleen SuSE Labs ak@suse.de Abstract... Some implementation details with changes over the existing i386 port are discussed. 1 Introduction x86-64 is a new architecture developed

More information

MRCP. Installation Manual. Developer Guide. Powered by Universal Speech Solutions LLC

MRCP. Installation Manual. Developer Guide. Powered by Universal Speech Solutions LLC Powered by Universal Speech Solutions LLC MRCP Installation Manual Developer Guide Revision: 39 Last updated: August 28, 2017 Created by: Arsen Chaloyan Universal Speech Solutions LLC Overview 1 Table

More information

Administrivia. Lab 1 due Friday 12pm. We give will give short extensions to groups that run into trouble. But us:

Administrivia. Lab 1 due Friday 12pm. We give will give short extensions to groups that run into trouble. But  us: Administrivia Lab 1 due Friday 12pm. We give will give short extensions to groups that run into trouble. But email us: - How much is done & left? - How much longer do you need? Attend section Friday at

More information

Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t

Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t Memory Management Ch. 3 Memory Hierarchy Cache RAM Disk Compromise between speed and cost. Hardware manages the cache. OS has to manage disk. Memory Manager Memory Hierarchy Cache CPU Main Swap Area Memory

More information

Memory Management Ch. 3

Memory Management Ch. 3 Memory Management Ch. 3 Ë ¾¾ Ì Ï ÒÒØ Å ÔÔ ÓÐÐ 1 Memory Hierarchy Cache RAM Disk Compromise between speed and cost. Hardware manages the cache. OS has to manage disk. Memory Manager Ë ¾¾ Ì Ï ÒÒØ Å ÔÔ ÓÐÐ

More information

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table Question # 1 of 10 ( Start time: 07:24:13 AM ) Total Marks: 1 LRU page replacement algorithm can be implemented by counter stack linked list all of the given options Question # 2 of 10 ( Start time: 07:25:28

More information

Adding hardware support to Buildroot

Adding hardware support to Buildroot Adding hardware support to Buildroot Pierre Ficheux (pierre.ficheux@openwide.fr) CTO Open Wide / OS4I 08/07/2010 1 Several ways to get a distribution Using commercial product (Wind River, MV, ) => / $$$

More information

Introduction to Pintos

Introduction to Pintos Introduction to Pintos Prof. Jin-Soo Kim ( jinsookim@skku.edu) TAs Jong-Sung Lee (leitia@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Welcome to Pintos! What is

More information

PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18

PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18 PROCESS VIRTUAL MEMORY CS124 Operating Systems Winter 2015-2016, Lecture 18 2 Programs and Memory Programs perform many interactions with memory Accessing variables stored at specific memory locations

More information

This training session will cover the Translation Look aside Buffer or TLB

This training session will cover the Translation Look aside Buffer or TLB This training session will cover the Translation Look aside Buffer or TLB I will cover: What It is How to initialize it And How TLB exceptions are handled 1 First let me explain what we are dealing with:

More information

Protection. - Programmers typically assume machine has enough memory - Sum of sizes of all processes often greater than physical memory 1 / 36

Protection. - Programmers typically assume machine has enough memory - Sum of sizes of all processes often greater than physical memory 1 / 36 Want processes to co-exist Issues in sharing physical memory rotection - A bug in one process can corrupt memory in another - Must somehow prevent process A from trashing B s memory - Also prevent A from

More information

PathFinder-XD for MIPS Powered Devices. Simulator

PathFinder-XD for MIPS Powered Devices. Simulator v.1.0.6, 15 th January 2013 PathFinder-XD for MIPS Powered Devices Simulator Contents 1. Introduction 2 2. Installation 2 2.1 Windows Installation 2 2.2 Linux Installation 2 3. Using PathFinder-XD with

More information

CSE 451: Operating Systems Winter Processes. Gary Kimura

CSE 451: Operating Systems Winter Processes. Gary Kimura CSE 451: Operating Systems Winter 2013 Processes Gary Kimura Process management This module begins a series of topics on processes, threads, and synchronization this is the most important part of the class,

More information

Process Environment. Pradipta De

Process Environment. Pradipta De Process Environment Pradipta De pradipta.de@sunykorea.ac.kr Today s Topic Program to process How is a program loaded by the kernel How does kernel set up the process Outline Review of linking and loading

More information

MV V310 Android 4.0 Compilation

MV V310 Android 4.0 Compilation MV V310 Android 4.0 Compilation Microvision Co., Ltd. Document Information Version 1.0 File Name MVV310 Android Compilation.doc Date 2012. 4. 17 Satus Working Revision History Date Version Update Descriptions

More information

Embedded Linux Architecture

Embedded Linux Architecture Embedded Linux Architecture Types of Operating Systems Real-Time Executive Monolithic Kernel Microkernel Real-Time Executive For MMU-less processors The entire address space is flat or linear with no memory

More information

GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux

GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux BDMICRO http://www.bdmicro.com/ Brian S. Dean bsd@bdmicro.com April 24, 2007 Copyright (c) 2005 BDMICRO All Rights Reserved. GNU-AVR April

More information

FreeBSD on latest ARM Processors

FreeBSD on latest ARM Processors FreeBSD on latest ARM Processors EABI, Toolchain ARM Ltd. vasileios.laganakos@arm.com 9th of October, 2010 1 Outline 2 Background Why? Few things about ARM... ARM EABI The Project 3 Part of the Procedure

More information

SPPEXA TEACHLET: GETTING STARTED WITH L4RE CARSTEN WEINHOLD

SPPEXA TEACHLET: GETTING STARTED WITH L4RE CARSTEN WEINHOLD Faculty of Computer Science Institute of System Architecture, Operating Systems Group SPPEXA TEACHLET: GETTING STARTED WITH L4RE CARSTEN WEINHOLD AGENDA first contact with a microkernel OS getting to know

More information

Chapter. Overview. Tornado BSP Training Workshop Copyright Wind River Systems 1-1 Wind River Systems

Chapter. Overview. Tornado BSP Training Workshop Copyright Wind River Systems 1-1 Wind River Systems Chapter 1 Overview Tornado BSP Training Workshop Copyright 1-1 Overview 1.1 Integration Issues VxWorks Boot Sequence Tornado Directory Structure Conventions and Validation Tornado BSP Training Workshop

More information

Installation guide for Arcturus Networks Inc.'s uclinux release

Installation guide for Arcturus Networks Inc.'s uclinux release Installation guide for Arcturus Networks Inc.'s uclinux release 1 Mount the ISO image or the CD to /mnt mount -o loop uclinux-dist-2008-feb-05-r0-release.iso /mnt 2 Install tool chains Go to the /mnt directory

More information

2018/04/11 00:10 1/6 NuttX Protected Build

2018/04/11 00:10 1/6 NuttX Protected Build 2018/04/11 00:10 1/6 NuttX Protected Build NuttX Protected Build The Traditional "Flat" Build The traditional NuttX build is a flat build. By flat, I mean that when you build NuttX, you end up with a single

More information

COS 318: Operating Systems. Overview. Andy Bavier Computer Science Department Princeton University

COS 318: Operating Systems. Overview. Andy Bavier Computer Science Department Princeton University COS 318: Operating Systems Overview Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall10/cos318/ Logistics Precepts: Tue: 7:30pm-8:30pm, 105 CS

More information

COS 318: Operating Systems

COS 318: Operating Systems COS 318: Operating Systems Overview Kai Li Computer Science Department Princeton University (http://www.cs.princeton.edu/courses/cos318/) Important Times Lectures 9/20 Lecture is here Other lectures in

More information

The build2 Toolchain Installation and Upgrade

The build2 Toolchain Installation and Upgrade The build2 Toolchain Installation and Upgrade Copyright 2014-2019 Code Synthesis Ltd Permission is granted to copy, distribute and/or modify this document under the terms of the MIT License This revision

More information

ECE 598 Advanced Operating Systems Lecture 10

ECE 598 Advanced Operating Systems Lecture 10 ECE 598 Advanced Operating Systems Lecture 10 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 17 February 2015 Announcements Homework #1 and #2 grades, HW#3 Coming soon 1 Various

More information

ECE 598 Advanced Operating Systems Lecture 2

ECE 598 Advanced Operating Systems Lecture 2 ECE 598 Advanced Operating Systems Lecture 2 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 15 January 2015 Announcements Update on room situation (shouldn t be locked anymore,

More information

ECE 471 Embedded Systems Lecture 4

ECE 471 Embedded Systems Lecture 4 ECE 471 Embedded Systems Lecture 4 Vince Weaver http://www.eece.maine.edu/ vweaver vincent.weaver@maine.edu 12 September 2013 Announcements HW#1 will be posted later today For next class, at least skim

More information

Linux Everywhere. A look at Linux outside the world of desktops. CIS 191 Spring 2012 Guest Lecture by Philip Peng

Linux Everywhere. A look at Linux outside the world of desktops. CIS 191 Spring 2012 Guest Lecture by Philip Peng Linux Everywhere A look at Linux outside the world of desktops CIS 191 Spring 2012 Guest Lecture by Philip Peng Lecture Outline 1. Introduction 2. Different Platforms 3. Reasons for Linux 4. Cross-compiling

More information

Operating Systems. 09. Memory Management Part 1. Paul Krzyzanowski. Rutgers University. Spring 2015

Operating Systems. 09. Memory Management Part 1. Paul Krzyzanowski. Rutgers University. Spring 2015 Operating Systems 09. Memory Management Part 1 Paul Krzyzanowski Rutgers University Spring 2015 March 9, 2015 2014-2015 Paul Krzyzanowski 1 CPU Access to Memory The CPU reads instructions and reads/write

More information

COS 318: Operating Systems. Overview. Prof. Margaret Martonosi Computer Science Department Princeton University

COS 318: Operating Systems. Overview. Prof. Margaret Martonosi Computer Science Department Princeton University COS 318: Operating Systems Overview Prof. Margaret Martonosi Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall11/cos318/ Announcements Precepts: Tue (Tonight)!

More information

OPERATING SYSTEMS CS136

OPERATING SYSTEMS CS136 OPERATING SYSTEMS CS136 Jialiang LU Jialiang.lu@sjtu.edu.cn Based on Lecture Notes of Tanenbaum, Modern Operating Systems 3 e, 1 Chapter 5 INPUT/OUTPUT 2 Overview o OS controls I/O devices => o Issue commands,

More information

15 Sharing Main Memory Segmentation and Paging

15 Sharing Main Memory Segmentation and Paging Operating Systems 58 15 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per

More information

Question 13 1: (Solution, p 4) Describe the inputs and outputs of a (1-way) demultiplexer, and how they relate.

Question 13 1: (Solution, p 4) Describe the inputs and outputs of a (1-way) demultiplexer, and how they relate. Questions 1 Question 13 1: (Solution, p ) Describe the inputs and outputs of a (1-way) demultiplexer, and how they relate. Question 13 : (Solution, p ) In implementing HYMN s control unit, the fetch cycle

More information

IRIX is moving in the n32 direction, and n32 is now the default, but the toolchain still supports o32. When we started supporting native mode o32 was

IRIX is moving in the n32 direction, and n32 is now the default, but the toolchain still supports o32. When we started supporting native mode o32 was Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2002 Handout 23 Running Under IRIX Thursday, October 3 IRIX sucks. This handout describes what

More information

Experience with GNU, LINUX, and other Open Source on ARC Processors

Experience with GNU, LINUX, and other Open Source on ARC Processors Experience with GNU, LINUX, and other Open Source on ARC Processors Portability Is For People Who Cannot Write New Programs ELC-Europe 2010, Cambridge, October 27/28 Mischa Jonker, Ruud Derwig 1 Synopsys

More information

The UtePC/Yalnix Memory System

The UtePC/Yalnix Memory System The UtePC/Yalnix Memory System This document describes the UtePC memory management hardware subsystem and the operations that your Yalnix kernel must perform to control it. Please refer to Handout 3 for

More information

Getting Started U-boot

Getting Started U-boot Getting Started U-boot Document Description Keywords Abstract U-boot, lpc2294 This document is a simple user guide for how to use u-boot on lpc2294 mcu: setup u-boot and toolkit; make and program the image

More information

ECE 471 Embedded Systems Lecture 5

ECE 471 Embedded Systems Lecture 5 ECE 471 Embedded Systems Lecture 5 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 13 September 2016 HW#2 is due Thursday It is going OK? Announcements 1 Homework #1 Review Characteristics

More information

This section covers the MIPS instruction set.

This section covers the MIPS instruction set. This section covers the MIPS instruction set. 1 + I am going to break down the instructions into two types. + a machine instruction which is directly defined in the MIPS architecture and has a one to one

More information

Eclipse development with GNU Toolchain

Eclipse development with GNU Toolchain Eclipse development with GNU Toolchain Version 1.0 embedded development tools Acknowledgements Ronetix GmbH Waidhausenstrasse 13/5 1140 Vienna Austria Tel: +43-720-500315 +43-1962-720 500315 Fax: +43-1-

More information

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1 Memory Allocation Copyright : University of Illinois CS 241 Staff 1 Recap: Virtual Addresses A virtual address is a memory address that a process uses to access its own memory Virtual address actual physical

More information

MV 4412 Android 4.0 Compilation

MV 4412 Android 4.0 Compilation MV 4412 Android 4.0 Compilation Microvision Co., Ltd. Document Information Version 1.0 File Name MV4412 Android Compilation.doc Date 2012. 7. 12 Satus Working Revision History Date Version Update Descriptions

More information

Blackfin cross development with GNU Toolchain and Eclipse

Blackfin cross development with GNU Toolchain and Eclipse Blackfin cross development with GNU Toolchain and Eclipse Version 1.0 embedded development tools Acknowledgements Ronetix GmbH Waidhausenstrasse 13/5 1140 Vienna Austria Tel: +43-720-500315 +43-1962-720

More information

Efficient and Large Scale Program Flow Tracing in Linux. Alexander Shishkin, Intel

Efficient and Large Scale Program Flow Tracing in Linux. Alexander Shishkin, Intel Efficient and Large Scale Program Flow Tracing in Linux Alexander Shishkin, Intel 16.09.2013 Overview Program flow tracing - What is it? - What is it good for? Intel Processor Trace - Features / capabilities

More information

CS140 Final Review. March 16, 2018

CS140 Final Review. March 16, 2018 CS140 Final Review March 16, 2018 Processes and Threads A process is a single program (think an app on a phone). A thread is a single execution context. There can be many threads in a single process (e.g.

More information

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program. Language Translation Compilation vs. interpretation Compilation diagram Step 1: compile program compiler Compiled program Step 2: run input Compiled program output Language Translation compilation is translation

More information

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Lecture - 13 Virtual memory and memory management unit In the last class, we had discussed

More information

CS 134: Operating Systems

CS 134: Operating Systems CS 134: Operating Systems More Memory Management CS 134: Operating Systems More Memory Management 1 / 27 2 / 27 Overview Overview Overview Segmentation Recap Segmentation Recap Segmentation Recap Segmentation

More information

Virtual Memory 1. Virtual Memory

Virtual Memory 1. Virtual Memory Virtual Memory 1 Virtual Memory key concepts virtual memory, physical memory, address translation, MMU, TLB, relocation, paging, segmentation, executable file, swapping, page fault, locality, page replacement

More information

Virtual Memory 1. Virtual Memory

Virtual Memory 1. Virtual Memory Virtual Memory 1 Virtual Memory key concepts virtual memory, physical memory, address translation, MMU, TLB, relocation, paging, segmentation, executable file, swapping, page fault, locality, page replacement

More information

Address spaces and memory management

Address spaces and memory management Address spaces and memory management Review of processes Process = one or more threads in an address space Thread = stream of executing instructions Address space = memory space used by threads Address

More information

OPERATING SYSTEM. PREPARED BY : DHAVAL R. PATEL Page 1. Q.1 Explain Memory

OPERATING SYSTEM. PREPARED BY : DHAVAL R. PATEL Page 1. Q.1 Explain Memory Q.1 Explain Memory Data Storage in storage device like CD, HDD, DVD, Pen drive etc, is called memory. The device which storage data is called storage device. E.g. hard disk, floppy etc. There are two types

More information

Process Time. Steven M. Bellovin January 25,

Process Time. Steven M. Bellovin January 25, Multiprogramming Computers don t really run multiple programs simultaneously; it just appears that way Each process runs to completion, but intermixed with other processes Process 1 6 ticks Process 2 Process

More information

- Established working set model - Led directly to virtual memory. Protection

- Established working set model - Led directly to virtual memory. Protection Administrivia Virtual Lab 1 due Friday 12pm (noon) We give will give short extensions to groups that run into trouble But email us: - How much is done and left? - How much longer do you need? Attend section

More information

Scratchbox Remote Shell

Scratchbox Remote Shell Scratchbox Remote Shell Timo Savola tsavola@movial.fi Scratchbox Remote Shell by Timo Savola Copyright 2004, 2005 Nokia Revision history Version: Author: Description: 2005-02-08 Savola Based on Device

More information

CS 61 Section Notes 5

CS 61 Section Notes 5 CS 61 Section Notes 5 (Week of 10/22-10/26) Topics: Dangerous Instructions and Process Isolation Virtual Memory Memory Mapping Address Translation Some numbers Some Terms Processes and Fork What is a process?

More information

Compiling Software on UNIX. System Administration Decal Spring 2009 Lecture #4 George Wu Slides prepared by Joshua Kwan

Compiling Software on UNIX. System Administration Decal Spring 2009 Lecture #4 George Wu Slides prepared by Joshua Kwan Compiling Software on UNIX System Administration Decal Spring 2009 Lecture #4 George Wu Slides prepared by Joshua Kwan Today How to turn source code into programs that run on Linux? What if that software

More information

Chapter 3 Memory Management: Virtual Memory

Chapter 3 Memory Management: Virtual Memory Memory Management Where we re going Chapter 3 Memory Management: Virtual Memory Understanding Operating Systems, Fourth Edition Disadvantages of early schemes: Required storing entire program in memory

More information

16 Sharing Main Memory Segmentation and Paging

16 Sharing Main Memory Segmentation and Paging Operating Systems 64 16 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per

More information

Getting started with MPE Forth Cross Compilers

Getting started with MPE Forth Cross Compilers MICROPROCESSOR ENGINEERING LIMITED 133 Hill Lane, Southampton SO15 5AF, England Tel: +44 (0)23 8063 1441 Fax +44 (0)23 8033 9691 email: tech-support@mpeforth.com mpe@mpeforth.com 14 November 2013 Getting

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory Disk

More information

Outline. Format string attack layout. Null pointer dereference

Outline. Format string attack layout. Null pointer dereference CSci 5271 Introduction to Computer Security Day 5: Low-level defenses and counterattacks Stephen McCamant University of Minnesota, Computer Science & Engineering Null pointer dereference Format string

More information

CS399 New Beginnings. Jonathan Walpole

CS399 New Beginnings. Jonathan Walpole CS399 New Beginnings Jonathan Walpole Memory Management Memory Management Memory a linear array of bytes - Holds O.S. and programs (processes) - Each cell (byte) is named by a unique memory address Recall,

More information

Installing LEON VxWorks

Installing LEON VxWorks . Installing LEON VxWorks-6.7 i Installing LEON VxWorks Installing LEON VxWorks-6.7 Source distribution VXWORKS-6.7-INSTALL Version 1.0.20 september 2017 Kungsgatan 12 tel +46 31 7758650 411 19 Gothenburg

More information

LINUXBUILD User's Manual

LINUXBUILD User's Manual . LEON Linux Linux for LEON processors 2017 User's Manual The most important thing we build is trust LINUXBUILD User's Manual Linux build environment for LEON systems 1 www.cobham.com/gaisler Table of

More information

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure. File Systems I/O Management Hard Drive Management Virtual Memory Swap Memory Management Storage and I/O Introduction CSI3131 Topics Process Management Computing Systems Memory CPU Peripherals Processes

More information

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts Memory management Last modified: 26.04.2016 1 Contents Background Logical and physical address spaces; address binding Overlaying, swapping Contiguous Memory Allocation Segmentation Paging Structure of

More information

Recall: Address Space Map. 13: Memory Management. Let s be reasonable. Processes Address Space. Send it to disk. Freeing up System Memory

Recall: Address Space Map. 13: Memory Management. Let s be reasonable. Processes Address Space. Send it to disk. Freeing up System Memory Recall: Address Space Map 13: Memory Management Biggest Virtual Address Stack (Space for local variables etc. For each nested procedure call) Sometimes Reserved for OS Stack Pointer Last Modified: 6/21/2004

More information

Embedded Systems. Mail: Web: Université de Nice - Sophia Antipolis

Embedded Systems. Mail: Web:   Université de Nice - Sophia Antipolis Embedded Systems Mail: Stephane.Lavirotte@unice.fr Web: http://stephane.lavirotte.com/ Université de Nice - Sophia Antipolis A Smart Object A Smart Object: What is it? The Nabaztag example 23 cm high 418

More information

KVM/ARM. Linux Symposium Christoffer Dall and Jason Nieh

KVM/ARM. Linux Symposium Christoffer Dall and Jason Nieh KVM/ARM Linux Symposium 2010 Christoffer Dall and Jason Nieh {cdall,nieh}@cs.columbia.edu Slides: http://www.cs.columbia.edu/~cdall/ols2010-presentation.pdf We like KVM It s Fast, Free, Open, and Simple!

More information

Slide Set 4. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

Slide Set 4. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng Slide Set 4 for ENCM 369 Winter 2018 Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary January 2018 ENCM 369 Winter 2018 Section

More information

Khem Raj Embedded Linux Conference 2014, San Jose, CA

Khem Raj Embedded Linux Conference 2014, San Jose, CA Khem Raj khem@himvis.com Embedded Linux Conference 2014, San Jose, CA } Introduction } What is GCC } General Optimizations } GCC specific Optimizations } Embedded Processor specific Optimizations } What

More information

Lecture 4: Memory Management & The Programming Interface

Lecture 4: Memory Management & The Programming Interface CS 422/522 Design & Implementation of Operating Systems Lecture 4: Memory Management & The Programming Interface Zhong Shao Dept. of Computer Science Yale University Acknowledgement: some slides are taken

More information

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed Process Management CS 537 Lecture 3: Processes Michael Swift This lecture begins a series of topics on processes, threads, and synchronization Today: processes and process management what are the OS units

More information

Faculty of Computer Science Institute for System Architecture, Operating Systems Group. Complex Lab Operating Systems 2016 Winter Term.

Faculty of Computer Science Institute for System Architecture, Operating Systems Group. Complex Lab Operating Systems 2016 Winter Term. Faculty of Computer Science Institute for System Architecture, Operating Systems Group Complex Lab Operating Systems 2016 Winter Term Introduction Requirements Basic Operating Systems Know-How Virtual

More information

Virtual Memory Paging

Virtual Memory Paging Virtual Memory Paging An important task of a virtual-memory system is to relocate pages from physical memory out to disk Early UNIX systems swapped out the entire process at once Modern UNIX systems relay

More information

The Operating System Machine Level

The Operating System Machine Level The Operating System Machine Level Wolfgang Schreiner Research Institute for Symbolic Computation (RISC-Linz) Johannes Kepler University Wolfgang.Schreiner@risc.uni-linz.ac.at http://www.risc.uni-linz.ac.at/people/schreine

More information

OPERATING SYSTEMS CS136

OPERATING SYSTEMS CS136 OPERATING SYSTEMS CS136 Jialiang LU Jialiang.lu@sjtu.edu.cn Based on Lecture Notes of Tanenbaum, Modern Operating Systems 3 e, 1 Chapter 4 FILE SYSTEMS 2 File Systems Many important applications need to

More information

Evaluation of MIPS Prelinking

Evaluation of MIPS Prelinking Evaluation of MIPS Prelinking Shin ichi TSURUMOTO MITSUBISHI Electric Corporation Advanced Technology R&D Center Overview Obtained prelinker for MIPS, compiler and libraries, and ran them on our target

More information

User Guide Linux for AT91CAP9-STK Version 1.1. User Guide LINUX FOR AT91CAP9-STK VERSION: 1.1 1/11

User Guide Linux for AT91CAP9-STK Version 1.1. User Guide LINUX FOR AT91CAP9-STK VERSION: 1.1 1/11 User Guide LINUX FOR AT91CAP9-STK VERSION: 1.1 1/11 History of Changes Revision Issue Date Descripion Author Ver 1.0 2009-04-24 First version of the document Olivier Arnal Ver 1.1 2009-04-27 Minor modification

More information

RTLinux Installation Instructions

RTLinux Installation Instructions RTLinux Installation Instructions FSM Labs, Inc. http://www.fsmlabs.com April 20, 2001 Abstract This document is intended to guide the user through the installation steps needed to compile and install

More information

Memory Hierarchy. Mehran Rezaei

Memory Hierarchy. Mehran Rezaei Memory Hierarchy Mehran Rezaei What types of memory do we have? Registers Cache (Static RAM) Main Memory (Dynamic RAM) Disk (Magnetic Disk) Option : Build It Out of Fast SRAM About 5- ns access Decoders

More information

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems CSE 120 Principles of Operating Systems Spring 2018 Lecture 10: Paging Geoffrey M. Voelker Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient

More information

Making Address Spaces Smaller

Making Address Spaces Smaller ICS332 Operating Systems Spring 2018 Smaller Address Spaces Having small address spaces is always a good idea This is good for swapping: don t swap as often (because if address spaces are small, then RAM

More information

μc/probe on the element14 BeagleBone Black

μc/probe on the element14 BeagleBone Black Micriμm μc/probe on the element14 BeagleBone Black 1. Introduction Whether you are doing kernel, driver or application development in a Linux environment, it's likely that at some point, you will need

More information

This is the Memory Map section of the MIPS software training course.

This is the Memory Map section of the MIPS software training course. This is the Memory Map section of the MIPS software training course. 1 The CPU cold boots in Kernel Mode and is in Kernel mode when exception processing starts. In kernel mode everything is allowed, all

More information

Jlint status of version 3.0

Jlint status of version 3.0 Jlint status of version 3.0 Raphael Ackermann raphy@student.ethz.ch June 9, 2004 1 Contents 1 Introduction 3 2 Test Framework 3 3 Adding New Test Cases 6 4 Found Errors, Bug Fixes 6 4.1 try catch finally

More information

Software Development & Education Center

Software Development & Education Center Software Development & Education Center Embedded Linux & RTOS With ARM 9 µc Embedded Linux and RTOS with ARM9 µc Introduction The course is designed for those who want to pursue Linux based Embedded Systems.

More information

CS510 Operating System Foundations. Jonathan Walpole

CS510 Operating System Foundations. Jonathan Walpole CS510 Operating System Foundations Jonathan Walpole Course Overview Who am I? Jonathan Walpole Professor at PSU since 2004, OGI 1989 2004 Research Interests: Operating System Design, Parallel and Distributed

More information