25
. Skaali, Department of Physics, University of Oslo) FYS 4220 / 9220 – 2012 / # Real Time and Embedded Data Systems and Computing Linux for Embedded / Real-time systems

What is Linux ?

  • Upload
    dolph

  • View
    60

  • Download
    2

Embed Size (px)

DESCRIPTION

FYS 4220 / 9220 – 2012 / # Real Time and Embedded Data Systems and Computing Linux for Embedded / Real-time systems. What is Linux ?. - PowerPoint PPT Presentation

Citation preview

Page 1: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo)

FYS 4220 / 9220 – 2012 / #

Real Time and Embedded Data Systems and Computing

Linux for Embedded / Real-time systems

Page 2: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

What is Linux ?

2FYS 4220 / 9220 - 2012 - Lecture #11

Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds with

assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX

and Single UNIX Specification compliance.

It has all the features you would expect in a modern fully-fledged Unix, including true

multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write

executables, proper memory management, and multistack networking including IPv4 and

IPv6.

Although originally developed first for 32-bit x86-based PCs (386 or higher), today Linux also

runs on (at least) the Alpha AXP, Sun SPARC, Motorola 68000, PowerPC, ARM, Hitachi

SuperH, IBM S/390, MIPS, HP PA-RISC, Intel IA-64, AMD x86-64, AXIS CRIS, Renesas

M32R, Atmel AVR32, Renesas H8/300, NEC V850, Tensilica Xtensa, and Analog Devices

Blackfin architectures; for many of these architectures in both 32- and 64-bit variants.

Linux is easily portable to most general-purpose 32- or 64-bit architectures as long as they

have a paged memory management unit (PMMU) and a port of the GNU C compiler (gcc)

(part of GNU Compiler Collection, GCC). Linux has also been ported to a number of

architectures without a PMMU, although functionality is then obviously somewhat limited.

Page 3: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 3FYS 4220 / 9220 - 2012 - Lecture #11

Page 4: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

Why linux for Embedded / Real-time?

• To start with, it is generally agreed that linux is not an OS for hard Real-time. However, most embedded /Real-time applications are soft: from mobile phones to web servers;

• Has a large and very active user community;

• Cheap, if you build the system yourself;– However, if you want to avoid this hassle there are ready cooked

implementations, for instance from Wind River (that are probably not cheap!);

• POSIX API;

• Probably fewer Single Board target architectures supported by linux than by VxWorks;

• Not the same repetoire of RT systems calls as VxWorks

• Advantages and Disadvantages– The advantages of embedded Linux over proprietary embedded operating

systems include multiple suppliers for software, development and support; no royalties or licensing fees; a stable kernel; and the ability to read, modify and redistribute the source code. The disadvantages include a comparatively large memory footprint (kernel and root file system); complexities of user mode and kernel mode memory access; and a complex device drivers framework. (Wikipedia)

4FYS 4220 / 9220 - 2012 - Lecture #11

Page 5: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 5FYS 4220 / 9220 - 2012 - Lecture #11

http://www.embedded-linux.co.uk/downloads/ESC-linux-is-not-an-rtos-slides.pdf

Take a walk:File: 2012-11_Linux_is_not_an_RTOS-Chris_Simmonds

Page 6: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 6FYS 4220 / 9220 - 2012 - Lecture #11

https://rt.wiki.kernel.org/index.php/Main_PageClick on: … and have a walk-through

Page 7: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

LINUXWind River

7FYS 4220 / 9220 - 2012 - Lecture #11

Page 8: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 8FYS 4220 / 9220 - 2012 - Lecture #11

«RTLinux»

From http://en.wikipedia.org/wiki/RTLinux

RTLinux is a hard realtime RTOS microkernel that runs the

entire Linux operating system as a fully preemptive process. It is the

hard realtime variant of Linux that makes it possible to control

robots, data acquisition systems, manufacturing plants, and other

time-sensitive instruments and machines.

It was developed by Victor Yodaiken, Michael Barabanov, Cort

Dougan and others at the New Mexico Institute of Mining and

Technology and then as a commercial product at FSMLabs. 

Wind River Systems acquired FSMLabs embedded technology in

February 2007 and made a version available as Wind River Real-Time

Core for Wind River Linux. As of August 2011, Wind River has

discontinued the Wind River Real-Time Core product line, effectively

ending commercial support for RTLinux.

Page 9: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 9FYS 4220 / 9220 - 2012 - Lecture #11

Take a quick look at «New Product Overview»

Page 10: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 10FYS 4220 / 9220 - 2012 - Lecture #11

GETTING STARTED: Workbench

Also: have a look at the White Paper «The Real Costs of Roll-Your-Own Linux»

Page 11: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

Linux and POSIX

• POSIX API : a key asset for embedded / Real-time software design.– Note, a web search will display some areas of incompatibility between linux and POSIX.

However, what was true yesterday is not necessarily true today, as Linux continues to develop;

– Another answer to the question «What is Linux missing to reach POSIX compatibilty?» is 15000 USD! This is probably the fee for a certification process.

11FYS 4220 / 9220 - 2012 - Lecture #11

Page 12: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 12FYS 4220 / 9220 - 2012 - Lecture #11

Page 13: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 13FYS 4220 / 9220 - 2012 - Lecture #11

linux real-time library - POSIX message queue API

Page 14: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

Test case: porting robot.c from VxWorks to Linux

• Step 1: Get an Integrated Development System (IDE)• Step 2: Replace or emulate VxWorks specific system calls• Step 3: Modify VxWorks POSIX stuff if incompatibility with Linux

14FYS 4220 / 9220 - 2012 - Lecture #11

Page 15: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 15FYS 4220 / 9220 - 2012 - Lecture #11

eclipse under linux on bus.uio.no

Page 16: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 16FYS 4220 / 9220 - 2012 - Lecture #11

Setting up a new C project

Page 17: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 17FYS 4220 / 9220 - 2012 - Lecture #11

Setting up a new C project

Page 18: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 18FYS 4220 / 9220 - 2012 - Lecture #11

Porting the cutting edge «robot» program to linux

Page 19: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

Linux message queues - mounting

19FYS 4220 / 9220 - 2012 - Lecture #11

Page 20: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

Linux message queues - naming

20FYS 4220 / 9220 - 2012 - Lecture #11

Page 21: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

A section of the ported code

21FYS 4220 / 9220 - 2012 - Lecture #11

Page 22: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo

Setup

22FYS 4220 / 9220 - 2012 - Lecture #11

Page 23: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 23FYS 4220 / 9220 - 2012 - Lecture #11

Page 24: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 24FYS 4220 / 9220 - 2012 - Lecture #11

Page 25: What is  Linux  ?

T.B. Skaali, Department of Physics, University of Oslo 25FYS 4220 / 9220 - 2012 - Lecture #11

Linux Documentation Project mirrors.kernel.org/LDP/

The canonical set of Linux online and printed documentation.

Linux Online www.linux.org

Linux information.

linux.org.uk www.linux.org.uk

Linux information from Great Britain (very good!)

Linux International www.li.org

An organization for promoting the use of Linux.

The linux-kernel mailing list FAQ http://www.tux.org/lkml/

Answers to frequently-asked questions about the Linux kernel (including how

to submit patches)

"A small trail through the Linux kernel“

http://www.win.tue.nl/~aeb/linux/vfs/trail.html

A walk-through of what the kernel does when it runs a small demonstration

program.

Linux kernel source finder

http://www.treblig.org/Linux_kernel_source_finder.html

A list of where to get architecture-specific kernel sources and patches.

Cool Linux sitesMaintained by people with lots of free time