When you receive your Gemstone card and boot up your system for the first time, this new world might feel a bit
unfamiliar. This guide is designed for users taking their first steps into the Linux and Ubuntu world to effectively use
T3 Gemstone OS. Intermediate to advanced Linux users may skip this section.
1. Linux Philosophy
1.1. Open Source Approach
T3 Gemstone OS is built on Debian/Ubuntu, which is based on the open-source software philosophy. This means you have full control over the system, can access the source code, and customize it according to your needs.1.2. “Everything is a File” Principle
One of the most fundamental concepts in the Linux world is the “everything is a file” principle. This means that everything from hardware components to processes is accessible through the file system. Hardware components like I2C, SPI, UART, and GPIO on your Gemstone card are also represented as files under this philosophy.1.3. Modular Structure
Linux systems have a modular structure. Each component performs a specific task and communicates with other components through standard interfaces. This approach allows you to run different applications and services independently on your Gemstone card. For example, if you don’t like the file manager in the Desktop image, you can easily replace it with an alternative file manager. This freedom sets Linux operating systems apart from their competitors.2. Linux Basics
2.1. Boot Process
When your Gemstone card boots up, the system starts in a specific sequence. First, the bootloader takes over, then the Linux kernel is loaded, and finally, the systemd init system starts running. During this process, the system detects your hardware, loads the necessary drivers, and starts system services.2.2. Kernel Space and User Space Separation
The Linux operating system is divided into two main sections for security and stability: Kernel Space and User Space. This separation controls access to hardware resources, ensuring system security.2.2.1. Kernel Space
Kernel space is where the heart of the operating system resides. This space provides direct access to hardware resources and manages the system’s core functions. For example, when you plug in a USB device, the relevant driver in kernel space detects the device and makes it ready for use. Similarly, all processes managing your computer’s memory, accessing the file system, and controlling network traffic occur in kernel space. Code running in this space has high privileges, and an error here can crash the entire system. Therefore, access to kernel space is tightly controlled.2.2.2. User Space
User space is where users directly interact. For example, when you open a terminal and type a command in T3 Gemstone OS or use a web browser, these applications run in user space. Programs in user space cannot access hardware directly; instead, they send system calls to the kernel to perform their tasks. For instance, a program wanting to read a text file requests the kernel to access the file system. This way, an error in a user space application does not affect the rest of the system and only causes that application to crash.2.2.3. Example Scenario: Opening a File
- User Space: The
cat /etc/gemstone/config.txt
command runs. - Kernel Space:
- The command makes a system call (
open()
syscall). - The kernel checks the file’s permissions (
chmod
&chown
rules). - If authorized, it accesses the disk and reads the data.
- The command makes a system call (
- User Space: The kernel sends the read data to the terminal.
2.3. Process Structure
Every running program is called a process. In Linux, these processes are organized hierarchically, and each has a unique identification number (PID) and a parent identification number (PPID). The first process to start is/sbin/init
, which is the parent of all other processes. In T3 Gemstone OS, this process is systemd
.
2.4. File System Hierarchy
The Linux file system (rootfs) is organized according to Unix standards. The root directory (/
) is the topmost point
of the system, and all other directories branch from here.
/bin
and/usr/bin
directories contain basic programs. Commands likels
,cp
, andmv
used daily are located here./etc
is the central hub for system configuration files. Network settings, service configurations, and system-wide settings are stored here./home
contains user folders. Your personal files and settings are located here./var
stores variable data files. Log files, databases, and temporary files created by processes reside here./dev
contains device files. Hardware components like I2C, SPI, UART, GPIO, and others on your Gemstone card are represented as files here./sys
provides system information from the kernel. Hardware status, driver parameters, and system statistics are found here./proc
provides information about running processes and the kernel. This virtual file system allows real-time monitoring of system status.
2.5. User Permissions
In the Linux world, there are two main user categories: the root user and regular users.2.5.1. Root User
The root user can be thought of as the CEO of a company. Just as a CEO has access to all departments, the root user has unlimited authority over the system. The root user can read, write, and delete any file on the system. They can run any program, change system settings, and even make irreversible changes like formatting the entire system. The root user perfectly exemplifies the principle that “with great power comes great responsibility.”2.5.2. Regular Users
Regular users are like department employees operating in specific areas of the system. While they have full authority in their ownhome
directories, they cannot modify system files, stop or start critical services, or make system-wide
changes. This restriction keeps the system secure and stable.
When working as a regular user on your Gemstone card, you can develop your projects, manage personal files, and run most
programs. However, you will need additional permissions for tasks like installing new software, managing system
services, or modifying system configuration files.
2.5.3. Gaining Root Privileges with Sudo
The sudo (superuser do) command acts as a secure bridge, allowing regular users to run specific commands with root privileges. Think of it as an employee obtaining a signed authorization from the CEO for specific situations. The biggest advantage of sudo is eliminating the risks of constantly working as the root user. Every mistake made as root poses a potential threat to the system. By elevating privileges only when necessary, you maintain both security and system integrity.3. Terminal Usage
The terminal is the heart of Linux systems. Almost anything you can do in the graphical interface can be done faster and more efficiently via the terminal. This section covers the essential commands you need to actively use the Linux terminal. This is just the tip of the iceberg. As you research the problems you encounter, you will start learning new commands and methods every day. When you begin automating repetitive tasks by asking, “How can I do this more effectively?” and using terminal commands, you will reach the level of a Power User. In commands, entries shown within< >
characters are dummy (example) inputs and should be replaced with actual inputs
as needed.
3.1. Getting Help with man Pages
One of Linux’s most powerful features is its comprehensive documentation system. To get detailed explanations for any command, you can use the man (manual) command:q
to exit.
3.2. Package Management with APT
Since T3 Gemstone OS is Debian/Ubuntu-based, it uses the APT (Advanced Package Tool) package manager. When you need to install new software or update existing software, you can use the APT tool:3.3. File Operations
Basic commands for working with files and directories:3.4. Changing File and Directory Ownership with chown
In Linux, every file and directory has an owner and a group. The chown (change owner) command is used to change the owner and/or group of files or directories. This is especially important in systems with multiple users or for access control of specific files.- Root privileges are required to change ownership of system files or files owned by other users.
- Be cautious when changing ownership of system files, as it may cause some applications to stop working.
You can facilitate file sharing by assigning users to groups. For example, users in the
dialout
group can access
serial ports without root privileges.3.5. Managing File and Directory Permissions with chmod
In Linux, every file and directory has specific permissions. These permissions determine who can read, edit, or execute your files. The chmod (change mode) command is used to change these permissions. Linux has three types of permissions:- Read (r): Permission to view the file’s content.
- Write (w): Permission to modify or delete the file.
- Execute (x): Permission to run the file as a program (for scripts or applications).
- Owner: The user who owns the file.
- Group: The group the file belongs to.
- Others: All other users.
cd
into the directory.
You can use the chmod command in two ways: symbolic (with letters) and numeric (with numbers).
3.5.1. Symbolic Method
Use+
and -
signs to add or remove permissions, and the following symbols to specify user groups:
u
: Ownerg
: Groupo
: Othersa
: All
3.5.2. Numeric Method
Each permission is represented by its binary equivalent:4
: Read (r)2
: Write (w)1
: Execute (x)
chmod 755 script.sh
means:
7
: 4 + 2 + 1 =rwx
(owner)5
: 4 + 1 =r-x
(group)5
: 4 + 1 =r-x
(others)
-
Avoid using
chmod 777
! This makes the file world-writable (rwxrwxrwx
) and poses a security risk. - Be cautious when changing permissions of system files, as it may cause some applications to stop working.
3.6. nano Text Editor
nano is an ideal terminal text editor for beginners. Its simple and intuitive interface allows you to edit configuration files without leaving the terminal:^
prefix represents the Ctrl
key, and the M
prefix represents the Alt
key. For example, use ^O
(Ctrl+O
) to save the file, ^X
(Ctrl+X
) to
exit, and M-6
(Alt+6
) to copy text.
3.7. Pipe and Output Redirection
One of Linux’s most powerful features is the ability to chain commands. The pipe (|
) symbol allows you to use the
output of one command as the input of another:
The
<
and >
characters are used for redirection and are not dummy inputs.3.8. Process Management with htop
htop allows you to visually monitor system resources and running processes:F9
to terminate processes, F3
to search, and F4
to filter. For example, start filtering with
F4
, type “htop,” press F9
, select 15 SIGTERM
, and press Enter
to send a termination signal to the “htop”
process, closing the program.
3.9. Network Management with nmtui
To manage your Gemstone card’s network connection, use the nmtui program:3.10. Checking Connected External Hardware
3.11. Managing Hardware Drivers
In Linux, drivers are typically implemented as kernel modules. Drivers for special hardware components on your Gemstone card are automatically loaded into the kernel at boot.3.12. Firewall Management
3.13. User Management
3.14. Systemd and Service Management
Systemd is the default init system in T3 Gemstone OS. It manages system startup, controls services, and monitors system status. The following examples use the nginx service. Replace “nginx” with the name of the service you want to configure. If you don’t know the service name, you can find it using thesystemctl list-units
command.
3.14.1. Checking Service Status
3.14.2. Starting and Stopping Services
3.14.3. Configuring Automatic Startup
3.14.4. Creating Custom Services
To create a systemd service file for your own application, create a.service
file in the /etc/systemd/system/
directory.