Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Biscuit: an operating system written in go

559 visualizaciones

Publicado el

Biscuit is a monolithic operating system kernel that is written in Go. This talk introduces the kernel and demonstrate how to build, install, and analyze the code.

Publicado en: Tecnología
  • Sé el primero en comentar

Biscuit: an operating system written in go

  1. 1. Biscuit: An Operating System Written in Go SeongJae Park <>
  2. 2. These slides were presented for 1st GDG Golang Korea Meetup (
  3. 3. This work by SeongJae Park is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit
  4. 4. I, SeongJae Park ● SeongJae Park <> ● PhD candidate at Seoul National University ● Interested in memory management and parallel programming in OS kernels
  5. 5. The kernels are written in the C language ● The C language was designed for the operating system kernel (UNIX) ● Most popular *NIX kernels (C, BSD UNIXs, ...) are written in the C language
  6. 6. Why not the C++? > When I first looked at Git source code two things struck me as odd: > 1. Pure C as opposed to C++. No idea why. Please don't talk about > portability, it's BS. *YOU* are full of bullshit. C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use C. - Linus Torvalds, 2007-09-06 (
  7. 7. … How about Go? >I wonder what is your opinion about the Go language. Does >it look like a move in the right direction? Hey, I think Go picked a few good and important things to look at, but I think they called it "experimental" for a reason. I think it looks like they made a lot of reasonable choices. But introducing a new language? It's hard. Give it a couple of decades, and see where it is then. - Linus Torvalds, 2010-06-08 ( ● Almost one decade has already passed (It’s 2019-05-30, now)...
  8. 8. Biscuit: An OS kernel in a high-level language ● Biscuit is a monolithic, POSIX-subset operating system kernel in Go ● A research project of the MIT PDOS lab ● Code is available ( ● The paper about the project has published to OSDI’18
  9. 9. Brief review of the paper ● I will reuse the slides from the authors rather than inventing another wheel ;)
  10. 10. Demonstration: Build & Run $ git clone go1.4; cd go1.4 $ git checkout release-branch.go1.4; cd src $ ./make.bash $ cd ../../ $ git clone; cd biscuit/src $ ./make.bash $ cd ../biscuit/ $ make qemu CPUS=2
  11. 11. Build: What the ‘make qemu’ did? ● Build bootloader, kernel (src/kernel/bins.go), and applications ● Create the root file system ● Start qemu with the root file system 220 qemu: gqemu 234 gqemu: go.img 235 $(QEMU) $(QOPTS) -nographic 224 QOPTS += -device ahci,id=ahci0 225 -drive file=go.img,if=none,format=raw,id=drive-sata0-0-0 226 -device 125 go.img: $(K)/boot $(K)/main.gobin $(SKELDEPS) $(FSPROGS) ./mkfs 126 ./mkfs $(K)/boot $(K)/main.gobin $@ $(SKEL) 146 $(K)/main.gobin: chentry $(GOBIN) $(K)/bins.go $(KSRC) $(FSRC) $(PSRC) biscuit/GNUmakefile
  12. 12. Code in detail: Page fault handling of Biscuit ● When a process accesses a memory area that is not mapped in the page table, page fault occurs ● Kernel allocates a page frame and create a mapping in the page table main (src/kernel/main.go) Sched_add (src/proc/proc.go) run (src/proc/proc.go) trap_proc (src/proc/proc.go) Pgfault (src/vm/as.go) Sys_pgfault (src/vm/as.go) Ptefor (src/vm/vm.go) pmap_pgtbl (src/vm/pmap.go)
  13. 13. Conclusion ● Biscuit is an OS kernel written in Go ● Benefits and costs of writing a kernel in Go is clear ● You can use, read, and modify the source :D
  14. 14. Thanks