X-Git-Url: http://rtime.felk.cvut.cz/gitweb/edu/osp-wiki.git/blobdiff_plain/19b49f4566aa2e8a35b5cd66165de07a3a73bb71..26a95ae8299cfef334d6e5ba293926feba00df22:/cviceni/2-en.mdwn diff --git a/cviceni/2-en.mdwn b/cviceni/2-en.mdwn index 9048d05c..296e6ea5 100644 --- a/cviceni/2-en.mdwn +++ b/cviceni/2-en.mdwn @@ -8,8 +8,8 @@ Aim of the Exercises The aim of this exercise is to practice building of the base system from open-source components presented during 2-nd lecture and motivate and practically introduce students for topics presented -during 4-th lecture “*Linux kernel - beginning, development, components -and device drivers; GNU libc and user space*”. If there are some +during 4-th lecture "*Linux kernel - beginning, development, components +and device drivers; GNU libc and user space*". If there are some steps or relations clear to you, we recommend you try Google to find information first and prepare to ask questions at the 4-th lecture. @@ -19,7 +19,6 @@ or even distributions. Perhaps the best known is the LAMP stack - Linux, Apache, MySQL, PHP. In today's exercise you will learn and experiment with another, very often used, a stack of [Linux][kenrel] + [BusyBox][bb] (+[Dropbear][dropbear] SSH server). - [BusyBox][bb] is a set of basic/standard UNIX utilities (shell, editor and such utilities as ls, mkdir, …) compiled into one binary. In combination with the Linux kernel it forms a complete minimal @@ -204,11 +203,7 @@ Possible Enhancements Additionally, you can work out minor improvements to the system that can simplify your further work within a booted system. -1. Můžete připojit souborový systém `/proc`, aby fungovaly příkazy - jako např. `ps` (výpis běžících procesů). Příkaz spusťte v - emulátoru, ne na vaší pracovní stanici. - - You can mount a `/proc` virtual filesystem to allow commands such as `ps` +1. You can mount a `/proc` virtual filesystem to allow commands such as `ps` (listing running processes) to function correctly. Use next command in the emulator, not on your workstation. @@ -228,17 +223,44 @@ can simplify your further work within a booted system. The RAM-disk has to be build again and the system should be booted again to test added functionality. +3. Messages print by kernel messages running in QEMU emulator can be + can be redirected to a virtual serial port and captured to a file. + This can be achieved by next QEMU options + + qemu -serial file:/tmp/virtual_guest.log ... + + and kernel is run with parameter `console=ttyS0` for console redirection + + qemu -serial file:/tmp/virtual_guest.log -append console=ttyS0 ... + +4. The network connection can be provided to the virtual system as well. + The most simple option is to use NAT on the user level and emulate + standard NIC card hardware for virtualized system + + qemu -net nic,vlan=0,model=ne2k_pci -net user,vlan=0 ... + +5. If QEMU or KVM supports Plan9 virtio network then it is it is possible + to promote part of the host system directory tree to the virtualized guest + system + + qemu -virtfs local,path=shared_dir_name,security_model=none,mount_tag=shared_tag ... + + The directory tree is then attached (mounted) from guest system through next command + sequence + + modprobe virtio + modprobe virtio_ring + modprobe virtio_pci + modprobe 9pnet + modprobe 9pnet_virtio + modprobe 9p + mkdir -p /mnt/shareddir + mount -t 9p -o trans=virtio shared_tag /mnt/shareddir + + Kernel Loadable Modules ======================= -Jaderné moduly jsou přeložené kusy kódu, které lze za běhu nahrávat do -Linuxového jádra. Pokud bychom chtěli nalézt analogickou věc v -uživatelském prostředí, pak by to byly *sdílené knihovny*. Jaderný -modul může obsahovat kód ovladače zařízení, podporu určitého -souborového systému, může přidávat do jádra nové funkce (např. -firewall) či sloužit jako knihovna pomocných funkcí pro jiné moduly -(např. libata). - Kernel modules are separate compiled pieces of code that can be loaded into running Linux kernel. If we wanted to find an analogy in the user environment, then it would be shared *shared/dynamically linked library*