In: Computer Science
When working in a Linux operating system, drives such as HDD, Optical and floppy drives are identified and labeled as? What are similarities and differences between a Linux OS and a Windows OS? Identify how Linux OS's assign serial ports? How are they labeled?
SIMILARLY BETWEEN LINUX AND WINDOWS
Windows and Linux both have the potential to accomplish the same things (like web hosting). There are differences, but in the long run, it is really a matter of what you need and if possible, want to use. Note: This list does not contain every single similarity between Windows and Linux. Somethings in this list have to do with the operating systems them-self. Other things in this list have to do with the way people make use of them.
1) Windows and Linux both can have limited “non-root” (Linux) and “non-administrator” (Windows) system users.
2) Both Windows and Linux can host PHP websites via FastCGI.
3) Both Windows and Linux have anti-virus software (many more anti-virus programs
for Windows, almost nothing for Linux).
Note: Linux can get viruses too, but without running a real-time anti-virus program on your Linux box, how can you have the potential to know that you do not have a virus on your Linux desktop/server?
4) Both Windows and Linux can run several different types of web services (e.g. web server, e-mail, DNS, MySQL, etc.)
5) Both Windows and Linux can run several pieces of hardware out of the
box.
6) Both Windows and Linux can blue-screen (in UNIX and Linux it’s called: Kernel Panic)
7) Both Windows and Linux make good use of your system resources.
8) Both Windows and Linux can run many days without a reboot.
9) Both Windows and Linux have file-systems that can become corrupted.
10) Both Windows and Linux are used in Professional companies for doing work.
11) Both Windows and Linux have open-source software that runs on them
(e.g. Apache Webserver, BIND DNS, SpamAssassin, Mozilla Firefox, Mozilla Thunderbird, Blender, etc.)
12) Both Windows and Linux can take a while to setup correctly.
For example, downloading and installing updates, making sure that SSH (or if you are using Windows, Remote Desktop) is setup correctly, drivers are installed and working properly, host-name for the computer is set, (if you are running a web-server) making sure that you have a separate user account for each web service you host (for increased security), etc.
(in my opinion, Windows takes less time setting up than Linux, but that may not apply in your situation).
13) Both Windows and Linux have support (Red Hat and SUSE are two for
Linux, and of course Microsoft supports Windows). Both also have free online support via web forums.
14) Both Windows and Linux can boot quickly.
15) Both Windows and Linux have pretty good security. Windows has Access Control Lists on its NTFS file-system, but Linux uses Read/Write/Execute bits by default instead.
Linux does have the ability to use ACLs, but I have never heard of Linux using ACLs by default.
Access Control Lists basically allow you to fine-grain your file-system security. The Read/Write/Execute bits are very limiting compared to ACLs.
16) Both Windows and Linux can get viruses (Windows is the larger target for malware, but this does not mean that Windows is easier to infect, nor does it mean that you are guaranteed to get malware when using Windows).
17) Both Windows and Linux are stable operating systems.
In my opinion, 99% of crashes on Windows are due to faulty hardware and/or drivers. However both Windows (NT family) and Linux are stable operating systems, when using good stable hardware and good stable drivers.
18) Both Windows and Linux can be secure, if you know what you are doing.
19) Both Windows file-systems and Linux file-systems suffer from hard drive fragmentation.
When you delete files (on any file-system, NTFS, ext4, ext3, etc.), you leave gaps in the file-system. These gaps will be filled with other files, but you will also have files before and after the new file. So when the computer goes to access the data, it has to sift though all of the data to find the bits and pieces it needs to complete the task.
20) Both Windows and Linux can read several file-systems (For Example: there are drivers for Windows that allow you to read EXT3/EXT4 Linux file-systems).
21) Both Windows and Linux run mission-critical applications.
22) Both Windows and Linux can be hacked by malicious Internet users.
23) Both Windows and Linux can be used to host online game matches on the Internet.
24) Both Windows and Linux have plenty of development tools to write software.
25) Both Windows and Linux work on embedded devices. (Windows CE is Microsoft’s OS for embedded devices)
26) Both Windows and Linux can run as a server on low-memory systems. (On Windows, you can use “Server Core” to not only save RAM, but to lower the attack surface of your server)
27) Both Windows and Linux can be used to program micro-chips.
28) Both Windows and Linux are used in industrial manufacturing of products.
29) Both Windows and Linux are used by governments to run and manage utilities.
30) Both Windows and Linux have 32 and 64 bit editions.
31) Both Windows and Linux have the ability to use virtual memory (SWAP).
32) Both Windows and Linux have the ability to run automated tasks set by the user. In Linux, this is called “Cron”. In Windows, this is called “Task Scheduler”.
33) Both Windows and Linux support Type-1 and Type-2 hypervisors for running virtual machines. A couple of examples of Type-1 hypervisors would be Hyper-V for Windows and KVM for Linux.
34) Both Windows and Linux have the ability to quickly communicate information between running programs on the computer. In Linux there is something called “Unix Domain Socket”. In Windows there is something similar (not exactly 1:1 though) called a “Named Pipe”.
35) Linux has integrated firewalls in its kernel (e.g. ipchains, Netfilter, nftables). Windows’ own integrated firewall is simply called Windows Firewall.
36) Both Windows and Linux support symmetric multiprocessing.
37) Both Windows and Linux are multitasking operating systems.
38) Both Windows and Linux have Disable Memory Execution support.
39) Windows and Linux both support Address Space Layout Randomization.
40) Linux has Mandatory Access Control kernel security modules such as SELinux, SMACK, TOMOYO Linux, and AppArmor. Windows supports Mandatory Access Control and already has it built into its kernel.
How Linux OS's assign serial ports? How are they labeled?
How do I check and configure serial ports under Linux for
various purposes such as modem, connecting null modems or connect a
dumb terminal?
Linux offers various tools and commands to access serial ports.
Linux uses ttySx for a serial port device name. For example, COM1
(DOS/Windows name) is ttyS0, COM2 is ttyS1, and so on. USB based
serial ports might use a name such as ttySUSB0. All these devices
are located under /dev/ directory.
Display Detected System’s Serial Support Under Linux
Simple run the dmesg command:
$ dmesg | grep tty
[ 37.531286] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [ 37.531841] 00:0b: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [ 37.532138] 0000:04:00.3: ttyS1 at I/O 0x1020 (irq = 18) is a 16550A
A note about USB based serial ports
USB to RS232 adapter cable connects from the USB port of a
computer to a device. Such serial to USB adapter connects to
devices for configuration or programming under Linux. Here is what
the dmesg command displays when you enter USB adapter:
$ dmesg
## use grep command/egrep command to filter out USB devices
##
$ dmesg | grep -i serial
$ dmesg | grep -i FTDI
Listing and using USB serial ports on Linux
Here is how it looks when I attached USB device:
$ sudo dmesg | more
Use the setserial command to check and use serial ports
The setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on.
Debian/Ubuntu Linux install setserial using the apt-get command/apt command
$ sudo apt install setserial
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: setserial 0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded. Need to get 35.9 kB of archives. After this operation, 120 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 setserial amd64 2.17-52 [35.9 kB] Fetched 35.9 kB in 1s (25.7 kB/s) Preconfiguring packages ... Selecting previously unselected package setserial. (Reading database ... 292992 files and directories currently installed.) Preparing to unpack .../setserial_2.17-52_amd64.deb ... Unpacking setserial (2.17-52) ... Setting up setserial (2.17-52) ... removing the old setserial entry in the rcn.d directories Update complete. update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults Stopping setserial (via systemctl): setserial.service. Created symlink /etc/systemd/system/multi-user.target.wants/setserial.service → /lib/systemd/system/setserial.ser vice. Created symlink /etc/systemd/system/multi-user.target.wants/etc-setserial.service → /lib/systemd/system/etc-setse rial.service. Processing triggers for man-db (2.9.1-1) ... Processing triggers for systemd (245.4-4ubuntu3.2) ...
CentOS/RHEL/Oracle Linux install setserial using the yum command
$ sudo yum install setserial
Fedora Linux user try the dnf command:
$ sudo dnf install setserial
Using setserial to list serial ports and devices
Now we installed required package. Open the termial and then
type the following setserial command:
$ setserial -g /dev/ttyS[0123]
If you get an error/warning that reads as “Permission denied,” try
running the command as the root user. For example, I am running it
using the sudo command/su command:
$ sudo setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: 16550A, Port: 0x1020, IRQ: 18 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
The setserial with -g option help to find out what physical serial ports your Linux box has.
Listing or displaying USB serial ports on Linux
Try:
$ sudo setserial -g /dev/ttyUSB[01]
/dev/ttyUSB0, UART: unknown, Port: 0x0000, IRQ: 0
Linux serial console programs
Once serial ports identified you can configure Linux box and use serial ports using various utilities:
How the drive's are Stored in Linux!
In the Windows world, each disk drive is labeled with an identifying letter such as C: for your hard disk and D: for the CD/DVD drive. In the Linux world, however, everything is part of the same filesystem organization. As such, if you have two or three hard disks, a CD drive, and a USB stick all plugged in, they will all be part of the same folder structure.
The diagram shown in Figure 4-9 should give you an idea of how everything hangs together.
Figure 4-9. Linux filesystem organization
Right at the top of the tree is the root folder, referred to as /. Inside this folder are a number of special system folders, each with a specific use. As an example, the /home folder contains a number of home directories for each user on the system. As such, the user account has the home folder set to /home/matthew.
Which Folder Does What?
The folder structure in a modern Linux distribution such as Ubuntu was largely inspired by the original UNIX foundations that were created by men with large beards. Although you don’t really need to know what these folders do, since Ubuntu looks after the housekeeping for you, some of you may be interested in the more important folders. To help, we present the Linux folder hit list in Table 4-1.
Table 4-1 Linux Folders
Folder
Use
/boot
This folder contains important files to boot the computer, including the bootloader configuration and the kernel.
/dev
Each device on your system (such as sound cards, Webcams, etc.) has an entry in this folder. Each application accesses the device by using the relevant items inside /dev.
/etc
Systemwide configuration files for the software installed on your system are stored here.
/home
Each user account on the system has a home directory that is stored here.
/lib
Important system software libraries are stored here. You should never need to delve into this world of the unknown.
/media
Media devices such as CD drives and USB sticks are referenced here when they are plugged in. More on this later.
/mnt
Other devices can be mounted too. Again, more on this later.
/opt
Optional software can be installed here. This folder is usually used when you want to build your own software. If you don’t build your own software, you ignore this folder.
/proc/sys
Information about the current running status of the system is stored here.
/root
This is the home directory for the main superuser.
/bin
Software that is vital for the system to be able to boot is stored here.
/sbin
Software that should be run only by the superuser is stored here.
/usr
General software is installed here.
/var
This folder contains log files about the software on your computer.
Configuration Files
In Table 4-1, /etc is described as storing systemwide configuration files for your computer. Aside from these files that affect everyone, there are also configuration files for each specific user. Earlier, when you customized Ubuntu’s look and feel, the settings were applied only to your current user account. So where are those settings stored?
Inside your home directory are a number of folders that begin with a dot (.), such as .config and .libreoffice. These folders contain the configuration settings for user-specific applications. By default, these dot folders are hidden in the graphical file viewer because you rarely need to access them. You can view these hidden files and folders when you are viewing your home folder by clicking View > Show Hidden Files in the menu or by pressing Ctrl-H.
DIFFERENCE BETWEEN LINUX AND WINDOWS
Basis for Comparison |
Linux | Windows |
Access | In Linux user has access to the source code of kernel and alter the code according to his need. It has its own advantages like bugs in OS will fix at a rapid pace and disadvantages like developers may take advantage of any weakness in OS if they found. | In windows every user won’t have access to the source code, only members of the selected group will have access to it. |
Flavors or Variety | Linux has various distributions which are highly customizable based on user needs. | Windows has very few customization options available. |
Licensing | In Linux with GPL- Licensed operating system, users are free to modify the software, can re-use in any number of systems and even they can sell the modified version. | In windows, with Microsoft license, users won’t have access to source code (can’t modify the software) and based on a number of licenses – we can install only on those number of computers. |
Command line | In Linux, command line is a very useful tool for administration and daily tasks but for end users, it doesn’t make much difference. | In windows, we have command line but can’t use as Linux command line. We need to go running and enter cmd then command line will open. |
Run level | Linux has inbuilt ability to stop at different run levels with this we can work using a command line and GUI if anyone has an issue. | In windows, if we encounter any problem in order to fix it, we need to reboot at run level 3 as an administrator/ root to find and fix the problem. |
Usability | Linux is complicated to install but has the ability to complete complex tasks easier. | Windows gives user’s a simple system to operate but it will take a longer time to install. |
Support | Linux has support via a huge community of user forums/websites and online search. | Windows has support which is easily accessible, online forums/ websites and it has paid support also. |
Updates | In Linux, users have full control of updates, we can install whenever we needed and it will take less time without any reboot. | In windows, updates will come at inconvenient times such as you are giving a print to the printer but suddenly update pop up will come which makes users frustrate and took more time to install. |
Security | Linux is more secure than windows where hackers or developers of viruses will find difficult to break through Linux. | Windows is the major target for developers of viruses and malware and it is most vulnerable without anti-virus software |