• 0 Posts
  • 26 Comments
Joined 2 years ago
cake
Cake day: June 23rd, 2023

help-circle







  • Well behaving programs give control back to the kernel as soon as they are done with what they are doing. If they don’t the control is forcefully taken away after some assigned time.

    It looks something like this:

    Something happens – e.g. a key is pressed – a process waiting for this event is woken up and gets e.g. 100ms to do it stuff. If it can handle the key press in 50ms, kernel notes it used 50 ms of CPU time and can give control to another process waiting for an event or busy with other work. If the key press triggered long computation the process won’t be done in 100ms, the kernel notes it used 100ms of CPU time and gives control to other processes with pending events or busy with other work.
    After one second the kernel may have noted:

    Process A: used 50ms, then nothing, then 100ms, another 100ms and another 100ms
    Process B: was constantly busy doing something, so it got allocated 6 * 100ms in that one second
    Process C: just got one event and handled it in 50ms
    Process D: was not waken at all

    So total of 1000ms was used – the CPU was 100% busy
    Of that 60% was process B, 35% process A and 5% process C.

    And then that information is read from the kernel by top and displayed.

    How does the OS even yank the CPU away from the currently running process?

    Interrupts. CPU has means triggering and interrupt at a specific time. Interrupt means that CPU stops what it is doing and runs selected piece of kernel code. This piece of kernel code can save the current state of user process execution and do something else or restore saved execution of another process.



  • Doesn't sound like the 'cheap small computer you can run your hobby electronics project on' that the original Pi used to be. It is not as cheap and a power hungry beast, still small, though. More and more like a PC and less and less a small cheap embedded platform. For some people it is a plus (I guess for most people here), for some not so much.

    I tend to build my projects on Raspberry Pi Pico now, but sometimes I would need something more powerful and Raspberry Pi 5 will be too much.








  • Raspberry Pi is based on smart phone chips, very specific chips from one manufacturer. Raspberry Pi Foundation is not the main customer for this manufacturer and chips used for Raspberry Pi are not their only product – and now, during the big ‘chip shortages’ and supply chain problems other customers and other chips are given priority. There are no (or not enough) new chips for Raspberry Pis so there are no new Raspberries, so availability is dropping and prices are soaring.

    I guess the same is true for most other SBCs.

    For my hobby projects I switched to Raspberry Pi Pico. It is not a SBC, you won’t run Linux on that, but it is a very capable microcontroller board which is enough for my needs. It is way cheaper much more available. And I won’t look back – it occurred to me that things are much simpler when there is no whole OS on my devices and everything the device does is in my own code.

    There are no problems with Pico availability, as it is based on a simpler, custom chip, designed by Raspberry Pi Foundation and manufactured for Raspberry Pi Foundation – they are no longer dependent on a single supplier.


  • I remember times (10 years ago?) when ‘light’ was considered normal and a friend would laugh at me for using white on black terminal and editor (actually VIM in a terminal) windows – „that is like old CRT monitors back in the day… now everyone normal uses black text on white background – like in Microsoft Word and everything, as that is natural”.

    So often people would argue just for current trend and not what works for them. For me black background is a must for terminal or code editors, but I don’t mind light themes in typical desktop applications. Dark is as good, and maybe even better (not enough to bother me), provided it is consistent, at least within the application, preferable over whole system.



  • Spotify:

    1. not linked to Apple ecosystem (which I don’t use at all). not part of any of the other big corps (Google, Amazon) trying get full control of our digital life.
    2. properly multi-platform. has a Linux client
    3. cheap enough, no ads. advertise
    4. great family plan, the best of all subscription services I have seen. Single payment, but each family member has their own separate account with their own password, not just a profile like on Netflix
    5. most of the music I care about is available there
    6. great remote control between different Spotify apps and devices. When I start Spotify on my Linux box I can control it with my Android phone, just like that