STOS, whats new? Gabriel Laskar <gabriel@lse.epita.fr> Jrmy - - PowerPoint PPT Presentation

stos what s new
SMART_READER_LITE
LIVE PREVIEW

STOS, whats new? Gabriel Laskar <gabriel@lse.epita.fr> Jrmy - - PowerPoint PPT Presentation

STOS, whats new? Gabriel Laskar <gabriel@lse.epita.fr> Jrmy Lefaure <blatinox@lse.epita.fr> What is STOS? A toy operating system Modular A teaching & experimenting tool Main principles of the STOS kernel


slide-1
SLIDE 1

STOS, what’s new?

Gabriel Laskar <gabriel@lse.epita.fr> Jérémy Lefaure <blatinox@lse.epita.fr>

slide-2
SLIDE 2

What is STOS?

  • A toy operating system
  • Modular
  • A teaching & experimenting tool
slide-3
SLIDE 3

Main principles of the STOS kernel

  • Monolithic kernel
  • Modular architecture
  • (probably) Multi-architecture
  • Simple.
slide-4
SLIDE 4

Emphasis on simple

  • No surprises
  • When in doubt, mimic the linux kernel APIs.
  • Still some differences with a classic unix kernel
slide-5
SLIDE 5

mkdir(3)

/* * In stos, mkdir can be emulated with open, * so use it instead of creating another syscall. */ int mkdir(const char* pathname, mode_t mode) { int fd = open(pathname, O_CREAT | O_DIRECTORY | O_EXCL, mode); if (fd < 0) return fd; close(fd); return 0; }

slide-6
SLIDE 6

signals

  • no signals planned in stos
  • use something like signalfd(2)
  • have 4 file descriptors opened by default
  • still not implemented, we need to have:

○ poll(2) ○ threads in userland

slide-7
SLIDE 7

mknod()

  • devfs is populated by the kernel
  • every instance of a driver are in separate directory:

○ com devices (serial lines) lives in “/dev/com/[1-4]” for pc

slide-8
SLIDE 8

STOS is now used for a kernel course!

slide-9
SLIDE 9

What have been done this year

  • initramfs (Paul Hervot)
  • command line (Paul Hervot)
  • testing modules (Louis Feuvrier & Gabriel Laskar)
  • porting stos to other architectures

○ arm (Jérémy Lefaure) ○ galileo (GISTRE)

  • acpi (Gabriel Laskar)
  • virtio (Nahim El Atmani)
slide-10
SLIDE 10

Testing the STOS kernel

  • We now have a simple test module
  • Some tests have been done (essentially for the course)

/** * register_gtest - register a global test to be executed by the test suite * later on in the boot process. * * @name: name of the test (will be copied) * @test: test function * @data: data to be passed to test function at execution * @failure: failure function to be executed when the test fails. */ int register_gtest(const char *name, void (*test)(struct gtest*), void *data, void (*failure)(struct gtest*));

slide-11
SLIDE 11

STOS on ARM

  • Theoretically multi-architecture: PowerPC, Sparc64,

ARM, x86 and x86_64

  • Only x86 is really maintained
  • Learning about kernel programming and ARM

architecture

slide-12
SLIDE 12

Kernel development on ARM

  • A lot of different versions
  • Different features
  • Each board has its own memory map
  • Linux uses device tree
slide-13
SLIDE 13

BeagleBone Black

  • Processor: AM3358
  • ARM Cortex-A8
  • 512MB SDRAM
  • Cheap (~55$)
slide-14
SLIDE 14

Build system

  • Quite complex
  • Used only for x86 target for a long time
  • ARM Toolchain
  • All modules in kernel mode
  • Bootloader (stage 3) and kernel in one file
slide-15
SLIDE 15

Stage 3

  • u-boot => stage 3 => STOS core
  • standalone program
  • provides memory segments
  • load kernel core (ELF)
  • enable pagination
slide-16
SLIDE 16

Current paging state

0x80000000 0x80400000 0xC0000000 0xC0400000 0x80400000 0x80000000 Physical Address Space Virtual Address Space 0x44f08000 0x44e08000 0x44f08000 0x44e08000

slide-17
SLIDE 17

Core

  • Most of arch independant code (klog,...)
  • Linker script
  • Serial console for klog
  • Backtrace
slide-18
SLIDE 18

Interrupts

  • Reuse old ARM code
  • Fix code
  • Simple API to add or remove handlers
  • Should be different depending on SoC
slide-19
SLIDE 19

Pagination (WIP)

  • Reuse the frame allocator
  • Like i386 pagination
  • Arch-dependant code to write (i.e invalidate page)
  • Snippets exist
slide-20
SLIDE 20

TODO

  • Jump to userland
  • Drivers (GPIO, I2C,...)
  • Other boards?
slide-21
SLIDE 21

Intel Galileo

slide-22
SLIDE 22

Goals

  • PFE for GISTRE students

○ Zackary Ayoun ○ Matthieu Simon

  • EFI support
  • Support for the Quark x1000 SOC
  • Consolidation of the STOS kernel
slide-23
SLIDE 23

How to reboot an OS?

  • triple fault
  • keyboard
  • strange ioport in some bios
  • apm
  • acpi
slide-24
SLIDE 24

Multiple usage for ACPI in STOS

  • Discover devices

○ rewrite the device tree with it ○ use it to discover PNP devices

  • Sleep states

○ reboot, duh !

slide-25
SLIDE 25

What is still needed

  • kernel thread apis
  • better dependency handling
  • kernel and userland timing apis
  • rework device apis
  • rework smp support
  • poll()
  • mmap() with files