Skip to content

WIP: Agnos Kernel Debugging

pencilpusher edited this page Dec 13, 2023 · 9 revisions

Common commands:

Mounting the drive for writing:

mount -o remount, rw /

Ubuntu system logs are located at /var/log and /sys/fs/pstore print the kernel logs to terminal:

dmesg

or print the last few lines with

dmesg | tail

if /sys/fs/pstore doesn't have any files, do a warm reboot then there should be logs.

tail -n 5 /sys/fs/pstore/console-ramoops-0

you may consider /sys/fs/pstore/console-ramoops-0 to be the live message ring you see with dmesg, but snapshotted from the prior boot. doesn't work across cold boots (it's in RAM, hence the name) but it's a fast easy way to glance back at a kernel panic

Connect to the device through a UART connection (slow):

On host computer:

sudo apt install screen
sudo screen /dev/ttyUSB* 115200`

press enter to wake up the UART connection and show the login prompt

username: comma

password: comma

Become root user at the root directory:

sudo -i && cd ..

Kernel building menuconfig: after cloneing the agnos-builder repo and agnos-kernel-sdm845 on your PC you can edit the kernel options with:

agnos-builder/agnos-kernel-sdm845/out# make menuconfig

then rebuild the kernal: ./build_kernel.sh and then copy the output/boot.img file to /tmp on the comma device and run the command:

sudo dd if=/tmp/boot.img of=/dev/disk/by-partlabel/boot_a && sudo dd if=/tmp/boot.img of=/dev/disk/by-partlabel/boot_b && sudo reboot
Clone this wiki locally