Spyke

Posts

learninglinux·Learning Linux together byHuntressHimbo

Linux Startup: Firmware to Desktop

I thought I would next give a shot at writing about the boot process. Ever wondered what the various steps are that take a computer from powered down to full graphical user interaces?

Well the typical order goes something like

Firmware -> Boot loader -> Kernel -> initramfs -> Root Filesystem -> init -> Login/session management -> Desktop

So the first piece of this process is firmware. Firmware is embedded in the computer, and in most circumstances is invisible to an average user. Implementations vary, but its main responsibility is to handle the power on signal and start the bootloader.

Bootloaders are an interesting area of programming and come in many shapes and sizes. For desktop linux, the most common options are things like grub, which gives you a nice menu to choose your kernel and other launch options. Like many other bootloaders grub is installed into an area of memory accessible to most firmware. Grub has to know where the kernel and everything is, so it also keeps a configuration you can manage through grubmkconfig If you like project boards, you'll probably end up more familiar with uBoot which is a less resource intensive loader used in embedded. The bootloader is responsible for finding the Kernel and loading it into memory, along with passing in any needed arguments. This means it has storage drivers and is often reading info out of your /boot folder.

Now we get to the Linux kernel, the heart of our operating system. The kernel is responsible for setting up the root filesystem and creating the framework to run your userspace. The kernel also creates many volatile file structures that don't persist across boots. /proc /sys and /dev being some of the major ones. The kernel is composed of a variety of modules that can be loaded and unloaded for managing different systems and hardware. You can see what is being used on your system with the lsmod command. modprobe and insmod can be used to change some of the configurations currently loaded.

On desktop the most common setup is to use initramfs to begin the next step. That is a shortening of init RAM filesystem. This is a compressed file system that contains utilities for probing hardware and discovering hardware layout that are too complex to handle without specialized programs like RAID filesystems. Initrsmfs is common, but also not entirely necessary. If the kernel can find and understand the root filesystem it can mount it on its own. Even more complex systems can be launched without initramfs, typically through the use of a flattened device tree specifying much of the physical layout of the electronics and the settings needed to bring them up safely on a System on Chip.

Once it is prepared, the kernel or initramfs accesses the root file system and launches init. This program is a part of systemd on most systems, and it follows a tree of dependencies to choose what to start on your system and when. It is responsible for determining when a program is ready and its dependencies are available.

Next up is login/session management. Here is where I will do my best, because I am less certain of some of the terms here. Linux logins are generally shell based. A shell is a program that acts as an interpreter for commands for the kernel. Shells can be interactive or not, and will use different configurations for each. Getty is the classic program for starting shells, and stands for "Get TTY" Once a shell is started it will ask for authentication if it is a login shell, and then run through the commands in .profile to setup variables. Most users won't see this unless they open a terminal, instead entering their authentication into a graphical login like LightDM (Light display manager). That display manager will then start your graphical session!

A graphical session is similar to a login on Windows. When you select a user and enter a password on Windows you are starting "explorer.exe" under your user. On Linux on many new systems this is Wayland, with a compositor like Sway. KDE Plasma uses one called KWin instead, but they have similar responsibilities. On older systems the display is managed by XOrg, with different desktop environments and compositors on top of that. The display manager starts a "session" of your desktop environment, which then sets up your UI and hotkeys. Some desktop environments restore programs opened during your last session, but not all are as feature-full. The variety of desktop experiences offered in Linux is enormous and ranges from desktops similar to Windows with things like Cinnamon, to tiling managers like DWM, and bare bones options like Openbox.

From there you are in your graphical session, and are ready to use your computer! Learning which tools your PC uses can help you figure out where you want to tweak it for different tasks. For many daemons or system services, systemd is the right place to configure. For user programs you can use systemd with userctrl, or your desktop environment. Enjoy tweaking your configuration :)

EDIT: Mint -> Cinnamon, Mint is the distro, cinnamon is the DE

View original on lemmy.zip
4
learninglinux·Learning Linux together byHuntressHimbo

Common locations and tools

Intimidating to be the first to post here, but I'm sure I'll get something wrong, and there's nothing like correcting someone for activity eh? 😆

So for a first off-the-cuff post, I thought I would just explain some file locations you'll see a lot learning linux, and mention a few tools. Feel free to add more of both in the comments!

Locations: / The most important location on any Linux machine, not to be confused with root's home directory, this is the starting point of the Kernel's access to any file, and in Linux everything is a file. This isn't a hard drive itself, but often points to the base of a hard drive. During bootup, one of the key steps is mounting the / filesystem. Essentially the operating system needs to establish a common logical tree to find things, and this is the base of that tree. I'm sure there is some exceptions I can't think of, but everything actively being used by your system will be under here somewhere.

. .. Related so I'll tackle these together. The . and .. directories will be found as children of every folder on your system, and point to places relative to your current one. The . directory is the equivalent of your current directory. .. points to the directory that contains the one you are in. Also . has a special meaning as the first character of a file name. It indicates in that case the file should be hidden to programs that respect that.

/home This is a very common, but not universal folder under root. It is semi-equivalent to the Users directory in windows. Most users will have a folder under here to store their files. /home/root/ is the typically inaccessible to non-privileged user home for the root user for instance. As a bonus ~/ will point to your own home folder on most systems.

/bin Home of the binaries. /bin, /sbin, /usr/bin and /usr/sbin are where most local applications will be installed. Don't remember the exact distinction between /bin and /sbin but sbin seems to contain more system utilities.

/usr is a directory for holding user files. Not the same as home, but I think in the sense that they are distinct from system files and libraries

/lib where most libraries go. /usr/lib is also around for this. You likely won't spend much time here.

/etc the place for all your system configurations. This contains mostly text files that are read by various programs for default settings. Only edit here if you want a change for all users. Usually for one user programs will read a file in /home/user/.config or a similarly unique to them locale.

/boot Not always around, but as you can imagine it holds important files for starting the system. In most Linux distros the file that contains the Kernel is in here, along with some other tools to help get you to a full machine. Don't mess around in here until you're ready to dig in.

/sys /proc These directories are used to store and display information usually used by the kernel. Both very powerful and very dangerous. Writing into the wrong file here can change electrical settings for devices, and it is easy to get lost in the looping/nested structure

/dev This is where your devices are kept. When you need to tell a program where a peripheral, a disk, or an internal resource can be accessed this is the folder for it

Tools:

Running out of steam so I'll keep it short

-x If I use this I mean a flag passed to the command. So cp is the copy command. If I want it to work recursively and copy subdirectories I need to give it the r flag. So the command becomes cp -r

ls LiSt files. Basically just prints out the contents of a directory. -a tells it to list everything even hidden files

cp for CoPy

cd is Change Directory

du lists Disk Usage You can use -d to ask it to summarize things up to a Depth and -h to ask it to print sizes in a way that is human readable

df lists Disk Free

sudo is used to run a command as root. This one comes from su the program it mostly replaces, which itself is I believe for Super User. So sudo is really Super User Do.

Lastly some flags are respected by many different programs. Not all, but many. So -h for help, -v for extra logs, and -V for version for instance are very common

That should be enough to get things started. Please chime in with essentials I missed, mistakes I committed, or tricks with any of the commands.

View original on lemmy.zip
30
dbd·Dead by DaylightbyHuntressHimbo

Who do you want to see in 2v8 next?

Couldn't post the link to the feedback survey so figured I'd just ask for peoples opinions here. What killer do you want to see in 2v8 next?

Personally I would love to have the Artist, the Hag, Unknown, or Pig added to the mode. Artist and unknown feel like a natural pair to add together like they did for Wesker/Nemesis. It would be cool to make them both do Weakened and Swarmed so they could follow each other up.

Hag I would like to see because I think she would be kinda simple to balance and work with and Trapper, Hag could get so silly. Playing trapper in 2v8 is already way better than playing him 1v4 and I bet the same would hold true for hag. Having the time to set up webs while your partner disrupts gens and then ramping up in the mid-game as your prep starts to come to fruition is a great gameplay loop.

Pig I just want to see because she's fun, but she is probably on the Danger list with Plague and Sadako where they might be way too good in 2v8.

So what are your thoughts who do you want to play? Who do you want to pair with your already-in-the-mode fave?

View original on lemmy.zip
2
showerthoughts·ShowerthoughtsbyHuntressHimbo

Anarchists and Tankies could benefit from a Codex Alera 'Gadara' relationship a.k.a. trusted enemies

I was listening to this series on audio book in the shower when this occurred to me. 'Gadara' is a fantasy species of wolfpeople's word for enemies that are respected and even trusted. A worthy foe sort of thing.

The idea is that the predatory wolf people believe friends can betray you, but an enemy can be trusted to act in their own self interest if they show themselves to be an honorable sort. Each party to the relationship maintains their status as enemies and expects the other to kill them if given the opportunity, but also can work together against threats to both. Being a gadara to someone also confers a bit of protection with your gadara's allies. A gadara can vouch for each other, and have laid claim to the honor of killing the other. So vouching for a gadara is saying "I want to be the one to kill this one, please respect that and leave them to me."

So to bring this around, an understanding between individual tankies and anarchists where both parties understand their ideals are incompatible, but the other can be trusted to work against fash would be a pretty useful arrangement. If we don't look past each other to the greater threat of fascism we won't be around long enough to get to have our fight in the end.

View original on lemmy.zip
-10

Maybe this is why they cancelled the show rule

cross-posted from: https://lemmy.zip/post/56254663

Trump is really trying hard to make Robert Jordan look like a prophet 💀

Explanation: Trump has some really strange parallels to Elaida from Wheel of Time. Their ego, incompetence, and obessession with "restoring greatness" are close enough to be weird, but it only gets weirder when you think about Elaida bulldozing the warder grounds to construct her own palace and abducting kings to restore the towers influence

View original on lemmy.zip
64