Operating Systems 2017F Lecture 6: Difference between revisions

From Soma-notes
Created page with "==Video== Video from the lecture given on September 26, 2017 [http://homeostasis.scs.carleton.ca/~soma/os-2017f/lectures/comp3000-2017f-lec06-26Sep2017.mp4 is now available]...."
 
No edit summary
 
Line 6: Line 6:


Code and files from the lecture (captured as they were at the end) are available [http://homeostasis.scs.carleton.ca/~soma/os-2017f/code/lec06/ here].
Code and files from the lecture (captured as they were at the end) are available [http://homeostasis.scs.carleton.ca/~soma/os-2017f/code/lec06/ 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

Latest revision as of 04:53, 4 October 2017

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