sources
(ordered chronologically by access time)
- Kbuild object variable name rationale
- Kbuild kernel module setup guide
struct file_operations
documentation, also- write(2)
- read(2)
- (Sadly) the Linux kernel
source itself, especially
- drivers/char/random.c
- drivers/char/mem.c
- Linux kernel labs - character device drivers
- Core API
- Driver API
- AM335x Technical reference manual
- BeagleBone Black system reference manual
- I2C device driver guide
tips
Start writing a kernel module that targets the kernel version of the BeagleBone image you're planning on using.
When the kernel documentation references manpages, these actually contain useful information. Manpages are not only for commands, but also include detailed documentation for the syscall interface and other C APIs.
Since most of the manpages referenced by the kernel are from section 2 (on system calls), you should append the number between brackets to the
man
command, i.e. to read 'write(2)' use the commandman 2 write
.Use
dmesg
with the-w
or-W
option (see man dmesg(1))If you somehow manage to corrupt/break your system in any way, the IoT images seem to work fine for
chroot
ing and fixing stuff. (Installing alinux-image-
package from chroot prints lots of errors, but seems to work fine afterwards?). I have not tried using the IoT images as an installation base, as we were steered away from using these images due to slow boot times.Just use the decompiled device tree blobs instead of trying to compile the device tree sources from the linux kernel.
You can check if your modified device tree blob is working by
cat
-ing the output of/sys/firmware/devicetree/base/led_extern/label
and checking if it matches with the label you set in theled_extern
section of your device tree source file.ZSH on the BeagleBone appears to print the prompt over command output if it is not terminated with a newline character. You can work around this by using
echo "$(cat ...)"
instead.
direct ethernet setup
You can use NetworkManager to both share your computer's existing
network connection and start a DHCP server for assigning IP addresses
automatically. This allows you to ssh
into the BeagleBone,
as well as share your internet connection (even eduroam!) over a single
direct ethernet connection.
Connect the BeagleBone to your computer using an ethernet cable, and make sure the BeagleBone is on. The ethernet port's link lights should start blinking.
Run
nmcli device
on your computer, note the name of the connection on the ethernet port:$ nmcli device DEVICE TYPE STATE CONNECTION wlan0 wifi connected eduroam enp0s25 ethernet connecting (getting IP configuration) Wired connection 1 lo loopback connected (externally) lo
(the automatically generated name
Wired connection 1
is the ethernet connection to the BeagleBone)Run the following command to enable sharing on this port (replace NAME with the connection name you found).
$ nmcli connection modify NAME ipv4.method shared ipv4.addresses 192.168.2.2/24
This assigns the ip address 192.168.2.2 to your computer, and gives the BeagleBone an address in the 192.168.2.0/24 range (edit this only if it conflicts with another subnet).
Run the following command to to activate the connection.
$ nmcli connection up NAME
(Optionally) use
nmap -sn 192.168.2.0/24
as root to find the IP address the BeagleBone got, or just connect to the BeagleBone using the hostname you configured before (in/etc/hostname
on the BeagleBone).Profit
When you're done doing stuff on the BeagleBone, and want to reverse all the above changes, simply run:
$ nmcli connection delete NAME
NetworkManager will automatically re-configure the ethernet connection for regular use the next time you plug in an ethernet cable.