Operating Systems 2017F Lecture 6

From Soma-notes
Revision as of 04:53, 4 October 2017 by Jamesklau (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Video

Video from the lecture given on September 26, 2017 is now available.

Code

Code and files from the lecture (captured as they were at the end) are available here.


Notes

What is a tar file?

  • A tar file stands for tape archive

Building a Kernel

  • Check the current version
    • Cd linux-source-4.4.0
  • To become root
    • Sudo su -
  • To configure a linux kernel:
    • Make menuconfig : to set options with an interface
    • Make localmodcomfig : to create a configuration based on modules loaded
    • Make oldconfig : to use a previously generated .config (cd/boot)
    • Ls mod: list all the mod that are loaded (only built)
  • To build a configured kernel from source:
    • Make: build the main kernel
    • Make modules: build the modules
  • To install a built kernel:
    • Sudo make install: put the kernel in /boot
    • Sudo make modules_install: puts the module in appropriate directory
    • Update-grub: tell the boot loader(grub) about the mew kernel and makes it bootable
  • Reboot to run the new kernel:
    • Sync
    • Sudo shutdown -r now
  • Check the version: Cat /proc/version


Dynamic linking

  • Brk: allocates space from the kernel
  • It is smaller in disk but bigger in memory
  • It shared library