This shows you the differences between two versions of the page.
lkd:laboratoare:01 [2024/07/07 19:21] daniel.baluta |
lkd:laboratoare:01 [2024/07/08 15:18] (current) daniel.baluta |
||
---|---|---|---|
Line 15: | Line 15: | ||
==== Presentation ==== | ==== Presentation ==== | ||
- | * follow slides at [[session 1]] | + | * follow slides at {{:lkd:laboratoare:lkd_01.pdf| Session 1}} |
==== Practical lab ==== | ==== Practical lab ==== | ||
Line 168: | Line 167: | ||
etc linuxrc opt sbin usr | etc linuxrc opt sbin usr | ||
</code> | </code> | ||
+ | |||
+ | In our setup, the rootfs used to boot the board can be found in ''~/work/images/rootfs.ext2''. Use the following instructions that add one of your own files into the root filesystem. | ||
+ | |||
+ | <code bash> | ||
+ | $ cd ~/work/images | ||
+ | # make a backup of the initial root filesystem | ||
+ | $ cp rootfs.ext2 rootfs.ext2.back | ||
+ | $ sudo mkdir /mnt/my_root | ||
+ | $ sudo mount -o loop rootfs.ext2 /mnt/my_root | ||
+ | |||
+ | # explore the contents of /mnt/my_root directory and notice that these are the exact files that you can find on the board | ||
+ | |||
+ | # create your own file | ||
+ | $ sudo touch /mnt/my_root/root/my_file | ||
+ | |||
+ | # unmount the filesystem | ||
+ | |||
+ | $ sudo umount /mnt/my_root | ||
+ | </code> | ||
+ | |||
+ | Now boot the board and notice that the file you created exists on the board! Follow the steps in section [[#boot_the_board |3. Boot the board ]]! | ||
+ | |||
+ | === 5. Explore the board === | ||
+ | |||
+ | After booting the board and getting the prompt explore the hardware board capabilities. | ||
+ | |||
+ | Check the current Linux kernel version: | ||
+ | <code bash> | ||
+ | $ cat /proc/version | ||
+ | </code> | ||
+ | |||
+ | Check the command line arguments used to start the Linux kernel: | ||
+ | <code bash> | ||
+ | |||
+ | $ cat /proc/cmdline | ||
+ | |||
+ | </code> | ||
+ | |||
+ | List all the cpus in the system: | ||
+ | <code bash> | ||
+ | |||
+ | $ cat /proc/cpuinfo | ||
+ | </code> | ||
+ | |||
+ | List all available free and used physical memory in the system. | ||
+ | |||
+ | <code bash> | ||
+ | $ free -h | ||
+ | |||
+ | </code> | ||
+ | |||
+ | List the physical memory map for the system: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | $ cat /proc/iomem | ||
+ | </code> | ||
+ | |||
+ | Notice the address range for ''System RAM'' and for the rest of devices. | ||
+ | |||
+ | Check the current list of filesystems supported by the kernel: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | $ cat /proc/filesystems | ||
+ | |||
+ | </code> | ||
+ | |||
+ | Check the current list of modules loaded in the system: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | $ cat /proc/modules | ||
+ | |||
+ | </code> | ||
+ | |||
+ | Finally check the kernel log: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | $ dmesg | ||
+ | |||
+ | </code> | ||
+ | |||