Most of my knowledge is in web development, dev-ops, and a fair amount in Linux tooling. One thing I've always wanted to learn was working with OS-level programming, but I've never really had a good excuse to get into it until I got a Pinephone. I've taken a university course where I've written programs in C that do system-level calls, as well as creating some simple ARM assembly code, so I suppose I do have a little experience.
To start simple, if I want to for example create a CLI tool that toggles the flashlight on the Pinephone, what fundamentals should I learn first before going about that? I'd also like to try and make a CLI tool to interface with the modem on the Pinephone just for the learning experience.
The material for OS-level programming feels a bit impenetrable for a noob like me, so maybe you guys have some good suggestions?
The flashlight, along with many other things, is controlled by reading and writing 'files' under the /sys pseudo-filesystem. You can do that using normal shell tools like echo, tee, pipes etc. or by using a programming language's file read/write methods. In this case you're looking to write either 0 or 1 to /sys/devices/platform/led-controller/leds/white:flash/brightness - note the permissions on that file which may mean you'll need to use sudo or similar to access it.
What level do you want to access the modem at? Low level access is easiest via the serial port using AT commands. Most of the OS versions abstract that out via either ModemManager or oFono, in which case you'd access the modem through those using a dbus interface.
The other bit is how to get things into and out of your program via the cli, but that's usually address in or soon after 'Hello World.'
I would say that programming could be difficult and not able to focus while you are a student so in that case you can less y ne writing service which can provide you so many options for writing your homework in a perfect way
You can do quite a lot in the shell. Which is quite arcane, but I am glad I learned it. Comes in handy all the time. Woolidge FAQ (which is linked from #bash MoTD on libera.chat) is a very good resource here.
Personally I read 'system level OS programming' to mean something like writing kernel drivers in C. In which case there is a famous book about that. But maybe that's not what you mean.
We are lucky in that there are tons of resources available nowadays with the Internet. But you can still learn a lot studying man and Gnu Info pages. The path to true wizardry lie through spending many hours reading such tomes of ancient wisdom.
If you can expand on your interests, maybe some more specific resources can be suggested.