FreeBSD Serial Ports


15.1. Admission

UNIX has always supported communication with serial ports. The fact is that the first computers in the UNIX environment used serial ports as outputs and inputs for users. Things have changed a lot since the “medium” terminal consisted of a serial printer operating at 10 characters per second and keyboard.
This chapter will show you some of the paths that FreeBSD uses with serial ports.

15.2. The Basics

This section should give you basic information about serial ports. If you do not find enough information on topics that interest you, check the “TERMINAL and Dial’up connections” section of this document.

The ttydX or cuaaX device is used to open the application. When the process opens the device, it accepts its basic input / output settings. You can see them by issuing the following command from the command line:

#stty -a -f / dev / ttyd1

When you change the settings of this device they will work until the device is not closed. As soon as it is opened, it will return to the basic settings. To make changes to the basic settings, you should open and adjust the device’s “initial state”.

For example, to enable the device in the configuration: CLOCAL mode, 8 bits and XON / XOFF flow controll as the basic settings for ttyd5, you should issue the following command:

#stty -f / dev / ttyid5 clocal cs8 ixon ixoff

A good place to put such configurations is /etc/rc.serial. When we place changes in it, the launched applications will download settings for individual devices (in this case, ttyid5) and accept them as standard.
Of course you will still be able to change these values ​​from the command line.

You can of course also prevent changes to settings by other applications by putting the device in a locked state. For example, to block the speed of the ttyd5 device at 57600 bps, the following command would have to be executed:

#stty -f / dev / ttyld5 57600

Now the application that will open the ttyd5 device and will try to change the speed on the port will be blocked at 57600 bps.

Of course, you should create settings of the initial state and lock status of the device with the possibility of writing only by the root. The MAKEDEV script does not do this when you create the device’s settings entries.

15.3. terminals

Terminals provide a more convenient and cheaper way to access your system when you are not at the server console but you are connected to the network. This chapter describes how to use terminals in FreeBSD.

15.3.1. Use and types of terminals

The original UNIX system did not have a console. Instead, people would enter and run programs using terminals that were connected to a computer-server using serial ports. It’s quite like if we used a modem and any software terminal to call this another remote system in which we can only work in text mode.

Today’s PCs have consoles that are capable of high-quality graphics, but the ability to maintain a serial port connection continues to exist as with all UNIX systems today. FreeBSD is not an exception here. Using a terminal connected to an unused serial port, you can log in and run any program that you could normally run on the console or in the xterm window in X Window.

For large users, you can connect multiple terminals in the FreeBSD system and place them on the employees’ desks. For “home users”, computers like the older IBM PC or Macintosh can be used, which will be connected as a network terminal to a more powerful computer on which FreeBSD will run. You can replace something that would be a single-user computer into a powerful multi-access system.

There are three types of terminals in the FreeBSD system:

  • “silly” terminals
  • PCs working as terminals
  • Windows X system terminals

They are described in the following sections. Stupid terminals

Stupid terminals are specialized parts of the equipment that you can connect to the server through serial ports. They call themselves stupid because they only have enough computing power to display, send and receive text. You can not run any program on it. The computer to which we connect “silly” terminals has all the necessary computing power needed to run word processors, compilers, mail client, games and many other tools.

There are many types of stupid terminals, created by many different companies, such as Digital Equipment Corporation’s (DEC) and JKO terminal VT-100 and Wyse’s WY-75. Almost every one of them will work in the FreeBSD system. Some of the higher-end terminals may even display graphics, but few software packages can use these advanced features.

Stupid terminals are very popular in networks where their users do not need access to graphical applications, such as those available in the X Windows system. PCs working as terminals

If stupid terminals only have the ability to display, send and receive text, then certainly any “unnecessary” computer can work as a stupid terminal. All you need is the right cable and programmable terminal emulation to run on your computer.

This configuration is the most popular at home. For example, if someone is currently working on your FreeBSD console, you can work at the same time while connected to a computer with less power but only working in text mode to your FreeBSD computer. Terminals of X Windows systems

The Windows X system terminals are the most sophisticated of the available terminals. Instead of connecting them via serial ports, they are usually connected to the network via Ethernet. They can use X system applications, not just text ones.

This chapter does not provide a description of the installation, configuration or use of X terminals. We introduced X terminals only because of the completeness of this chapter.

15.3.2. Cables and ports

To connect the terminal to the FreeBSD system you need the right cable and serial port to connect to. This section will tell you what you need to do. If you are already familiar with the terminal topic and have the right cable, you can go straight to CONFIGURATION. Wires

Because the terminals use serial ports, you will have to use a serial cable (RS-232C) to connect to the computer on which FreeBSD is running.

There are two types of serial cannon. Which one you use depends on which terminal you want to connect

  • If you want to connect a personal computer as a working terminal, use a null-modem cable. This cable is used to connect 2 computers together.
  • If you have a computer that has been factory-designed as a terminal, the best source of information will be the documentation attached to it. If you do not have one, try connecting via null-modem. If it does not work, try a standard cable.

Also, the serial port you use in the terminal and in FreeBSD must have a suitable free port so that you can use the given cable. Null-modem cable

Zero modem cable transmits some signals directly and some switches. For example, sending data takes place via one pin in the sending computer and is received by another pin in the computer at the end of the transmission.

If you would like to make your own cable yourself, below is a table showing recommended paths to build your own cable for null-modem connection. It shows the connector types RS-323C, signal types and pin numbers in the DB-25 plug.

signal pin pin signal  TxD 2 connected to 3 RxD  RxD 3 connected to 2 TxD  DTR 20 connected to 6 DSR  DSR 6 combined with 20 DTR  SG 7 combined with 7 SG  DCD 8 connected to 4 RTS  RTS 4 connected to 5 CTS  CTS 5 connected to 8 DCD    Note. For DCD to RTS, connect pins 4 and 5 internally in  the socket, and only with the 8-pin pin on the 2nd side. Standard RS-232C cable

The standard RS-232C cable transmits signals one-to-one. This means that a pin sending data at one end of the cable goes to the pin sending data at the other end. This is the type of cable to connect the modem and some terminals to FreeBSD. ports

Serial ports are direct devices through which data is transferred between the FreeBSD server and the terminal. This section will describe what types of ports we can use and how they are addressed in FreeBSD. Types of ports

A few sentences about existing serial ports. Before you buy or build a cable, you should be sure that it will match the port on your terminal and on the computer on which FreeBSD runs.

Most terminals have a DB-25 port. Personal computers, including PCs running FreeBSD, have DB-25 or DB-9 ports. If you have a multiport card on your computer, you can also have RJ-12 or RJ-45 ports.

It is best to check the documentation included with the equipment and look for the specifications of used ports in it. Sometimes, however, it is enough to look closely at the equipment to find the appropriate ports. Port naming

In FreeBSD, access to serial ports can be found in the / dev directory. You can use them in two different ways.

  • Ports used to receive connections are called / dev / ttydX where X is the port number starting from zero. Generally, we use these ports also for terminals. They require that a DCD signal appears on the line to start working.
  • Ports used to call connections are called / dev / cuaaX. Usually, these ports are not used for terminals but for modems. You can use them if the cable or terminal does not have CD (carrier detect) support.

See also the sio manual page (4) for more information.

If you have a terminal connected to the first serial port (COM1 in DOS), you should use / dev / ttyd0 to communicate with the terminal. If it is the second serial port (COM2) you should use / dev / ttyd1 etc.

Note. Check if your kernel is adapted to support communication over serial ports, especially when working with a multiport card. See the FreeBSD kernel configuration chapter for more information.

15.3.3. Configuration

This section describes what you need to configure in your system to enable opening sessions for terminals. I assume that you already have a correctly configured kernel that supports connections to serial ports through which the terminals connect.

In short, you have to pass the init process, which is responsible for process control and initialization, to start the getty process, which is responsible for starting the login program.

To do this you have to edit the / etc / ttys file. You have to do this of course from the root level to be able to make changes to this file.

  1. Add an entry to the / etc / ttys file to the device name from the / dev directory, if of course not already entered there.
  2. Specify that you want to run / usr / libexec / getty on this port, and specify the appropriate getty type from the / etc / gettytab file.
  3. Specify the type of terminal.
  4. Set the port to “on”
  5. Decide whether the port should be “secure”.
  6. Restart init to reload the file / etc / ttys.

Optionally, you can create your own getty which later you will use in step 2, making the appropriate entry in / etc / gettytab. This document will not tell you how to do it. For more information, read the manual gettytab (5) and getty (8).

In the following sections, we will describe in detail how to perform these steps. We will use a working example to illustrate what is needed to do this. In our example, we will be connecting 2 terminals to the system: Wyse-50 and the old 286 IBM PC and the Procomm terminal that emulates vt-100. We will connect the Wyse-50 terminal to the second serial line and 286 to the sixth serial port (multiport card).

If you want to find more information about the / etc / ttys file, read the ttys (5) man page. Adding an entry to the file / etc / ttys

The first thing you need to do is add the appropriate entry to the file / etc / ttys, if it is not already there.

The file / etc / ttys contains a list of all ports through which you can log into the system. For example, the first virtual console ttyv0 has its entry in this file. Thanks to this you can log in to the console via it. The file also contains entries about other virtual consoles, serial ports and pseudo terminals. For built-in terminals, such as serial ports, we make entries omitting their exact location (/ dev).

When you install FreeBSD, the file / etc / ttys contains entries for the first four serial ports: from ttyd0 to ttyd3. If you connect the terminal to one of these ports, you do not need to make any changes.

In our case, we connected Wyse-50 to the 2nd serial port, ttyd1, which is already in this file. However, we had to add an entry for 286 PC connected to the sixth port on a multiport card. Below is a fragment of the / etc / ttys file after we gave it a new entry:

ttyd1 “/ usr / libexec / getty std.9600” unknown off secure  ttyd5 Specifying the getty program

The next thing we need to do is determine the program that will be used to support the login process on the terminal. For FreeBSD, the standard program for this is / usr / lib / getty. It displays the login: command line.

The getty program gets (optionally) one paramath from the command line used by getty. The type of getty tells us about the characteristics of a given connection with the terminal, i.e. about the connection speed, and parity. The getty program gets its settings from the file / etc / gettytab.

The / etc / gettytab file contains many pre-defined settings for new and old connection types with the terminal. In almost all cases entries starting with std will work for terminals permanently connected to the server. This entry ignores parity. In this file there are lines with speed determination for std from 110 to 115,200 bps. Of course, there are no obstacles for you to add your own entries there. However, to learn more about it, read the gettytab (5) page in the manual.

When you set the getty type for the / etc / ttys file, make sure that the communication connections on the terminal agree.

For example, Wyse-50 has the following settings: no parity and 38 400 bps connection. PC 286 also set to lack of flexibility, but the speed is defined as 19200bps. Below are the lines in the file / etc / ttys in which we define these 2 terminals.

ttyd1 “/ usr / libexec / getty std.38400” unknown off secure  ttyd5 “/ usr / libexec / getty std.19200”

Attention. The second field, in which we define the program that is to be used to run the terminal, is closed in the quizzes. This is important because if we did not include this in quotes, the arguments for getty could be treated as the next field. Determining the basic type of terminal

The third field in the / etc / ttys file specifies the default terminal type for the port. For dial-up ports, you will enter unknown or dialup here because most users have a dial-up with virtually any type of terminal or firmware terminal. For computers permanently connected to the server, the terminal type does not change, so you can place the real terminal type there.

Users should use the tset command in their configuration files for their accounts (.login and .profile or other depending on the server specifications) to check the type of terminal and display the appropriate prompt if required. By setting the terminal type in / etc / ttys, we should do this so that users will not have problems logging in.

To find the right type of terminal supported by FreeBSD, you need to look at the file / usr / share / misc / termcap. There is a list of about 600-type terminal types. You can of course add more if you need it. However, to learn more about it, read the gettytab page (5) in the manual.

For example, Wyse-50 is the type of Wyse-50 terminal (although it can emulate other types, it will be left in Wyse-50 mode). The PC 286 is run from Procomm which emulates the vt-100 terminal. Below is the appropriate but not yet completed entry from the / etc / ttys file for our example.

ttyd1 “/ usr / libexec / getty std.38400” wy50 off secure  ttyd5 “/ usr / libexec / getty std.19200” vt100 Unlocking ports

The next field in the / etc / ttys file, which is the fourth in order, is the field that decides whether to open the port port. Putting it in it, we will start the init process for the second entry from the / etc / ttys file, ie getty, which will call us the login process. If you put there off, you will not get to get down and you will not be able to log in to that port.

Naturally, this field is set in the majority of cases to the value of on. Below is again a clipping of the / etc / ttys file with the configuration you have set. In both cases, we set the value of this field to on.

ttyd1 “/ usr / libexec / getty std.38400” wy50 on secure  ttyd5 “/ usr / libexec / getty std.19200” vt100 on Determining secure ports

We have already reached the last field (well, almost to the last one, there is an optional window field, but we will leave it). So the last field tells us if the port is safe.

What does a secure port mean?

This means that we can log into the root account from this port (or any other with UID = 0). On ports not specified as secure, no user with UID = 0 will be able to log in.

How to use secure and unsecured ports?

Marking the port as unsecured, the terminal to which we connect will not allow us to log in as a user with UID = 0. Users who know the root password for your server will first have to log in as normal users. To get root rights they will have to use the su command.

And that’s why there will be two records to help track down the path to obtaining root rights, both login and su commands are saved in system logs (and logins are also saved in the wtemp file).

Marking oprt as safe, we give you the option of logging in to the user with root rights. He will be (or other people who know the root password) log in directly as the root user. You do not have to use the su command then to get root rights.

Which type should you use?

Use “insecure”. Use the “secure” type only for terminals that are not in the public network and should ideally be located behind a “closed door” or a wall of fire.

And here are the complete entries for the file / etc / ttys, with a comment where the given terminals are located.

ttyd1 “/ usr / libexec / getty std.38400” wy50 on insecure           # Kitchen  ttyd5 “/ usr / libexec / getty std.19200” vt100 on insecure       # Guest Bathroom Forcing the init restart to reload the / etc / ttys settings

When you start FreeBSD, the first process, init, reads the contents of the file / etc / ttys and accordingly runs programs according to the list for each entry in which the fourth field was on, allowing you to log on to the given terminal.

After you edit and make changes to the / etc / ttys file, you do not have to restart the system so that init can see changes in this file. So, init will read the / etc / ttys file again when it receives the SIGHUP signal.

After you save your changes to the / etc / ttys file, send the SIGHUP signal to the init process by typing:

#kill -HUP 1

(The init process always has ID 1)

If everything has been configured correctly, and all cables are plugged into the appropriate communication ports, and the terminal is switched on, you should see the login lines. Your terminal is ready for the first login.

15.3.4. Troubleshooting

Even if the entire operations are carried out with the smallest details, something can go wrong. Below is a list of symoptoms and suggested solutions to the problem.

The login window does not appear

Make sure that the terminal is connected and attached to the current. If it is a personal computer that works as a terminal, make sure it is running program emulation on a good communication port.

Make sure that the cables are properly plugged into both computers.

Make sure that these are good cables.

Make sure that the terminal and FreeBSD are set to the same baud rate (bps) and parity. If you have a graphics terminal, make sure that the contrast and brightness are not reset. If it is a printer that works as a terminal, make sure that there is paper and ink in the right quantities and places.

Make sure that the getty process is started and it supports the terminal. Enter

#ps -axww | grep getty

to get a list of running getty processes. You should see an entry for your terminal in it. For example :

22189 d1 Is + 0: 00.03 / usr / libexec / getty std.38400 ttyd1

shows that the getty process is running on the second communication port ttyd1 and uses the entry std.38400 from / etc / gettytab.

If you do not run such a getty process, check if you have enabled the port in the / etc / ttys file. Make sure you have executed the kill -HUP 1 command

Strange stamps appearing instead of the login line:

Make sure that the terminal and FreeBSD are compatible with each other in terms of speed settings (bps) and parity. Check the getty process and be sure that you are using a good type of getty. If you do not edit / etc / ttys and do the kill -HUP 1 again

The characters are displayed twice and the password is not hidden

Switch terminal (or software terminal emulation) from “half duplex” or “local echo” to “full duplex”

15.4. Support for outgoing calls

This document will provide you with suggestions on how to set up FreeBSD as a system for accepting dial-up connections. This document is written based on the author’s experience (Guy Helmer) with FreeBSD version 1.0 and 1.1 and (and experience with dial-up connections on other UNIX systems), although this document may not answer all your configuration questions or provide examples of insufficient examples in your case. The author also does not assume liability for any loss of data resulting from the use of the guidelines contained herein.

15.4.1. Requirements

To start working on this chapter you need basic knowledge about the FreeBSD system. The author assumes that you have the FreeBSD system installed, you know how to edit files in it and how to use system manual. As a discussion described below, for a specific version of FreeBSD, there is a basic knowledge of terminology, modems and cabling. FreeBSD system version

The first thing we assume is that you’re using FreeBSD version 1.1 or higher (including version 2.X). FreeBSD version 1.0 contains two different network drivers, which complicates the situation. So, the serial device driver (sio) is refined in every release of FreeBSD, so in the newer version of FreeBSD there will be an improved and more efficient driver than in the earlier version of the system. Terminology

A quick explanation of the terminology:

bps  Bits per Second – the speed with which data is sent   (bits per second)    DTE  Data Terminal Equipment – for example, yours   computer    DCE  Data Communications Equipment – your modem    RS-232  EIA agency standard for communication with ports   serial for hardwar

If you need more information about terminology and subject of communication, the author recommends to read the “The RS-232 Bible” (unfortunately no ISBN number), which is worth recalling.

When we talk about the speed of data transfer, the author does not use the term “baud”. “Baud” refers to the amount of electrical state changes that can be obtained over a period of time, while “bps” is the correct term to use. External modems versus internal modems

External modems are less troublesome for dial-up connections because they can often be configured permanently through parameters stored in non-erasing RAM memory, and provide us with information about RS-232 signals through flashing diodes. Flashing LEDs impress the viewers, but they can also show us what the modem is doing right now.

Internal modems usually do not have non-ram RAM, so their configurations can only be done by setting jumpers. If the internal modem has even some diodes, then the use of them is quite uncomfortable because they are located in the back of the computer or are covered by the casing. Modems and cables

The basic knowledge on this subject is taken as follows:

  • You know how to connect a modem to a computer so that they can communicate with each other
  • You are familiar with the commands of your modem, or you know where to look for them if needed.
  • You know how to configure your modem (probably through a program for communication with the terminal) where you can set the RAM parameters “permanently”.

The first thing to do is connect the modem, it is usually straightforward, most of the serial cables work without problems. You will also need a cable with the right plug (DB-9 or DB-25 female or male) at each end, and the cable must be DCE-to-DTE with the following sync cables:

– Transmitted Data (SD)        – Recived Data (RD)            – Request to Send (RTS)            – Clear to Send (CTS)          – Data Set Ready (DSR)         – Data Terminal Ready (DTR)          – Carrier Detect (CD)          – Signal Ground (SG)

FreeBSD requires RTS and CTS signals to control the data stream at speeds above 2400 bps, the CD signal to be detected when the response arrives or the line is raised, and the DTR signal to reset the modem after the session ends. In some cables there are more lines than required to send signals, so if you have a problem, such as a logged session does not end when the line “rises”, the problem may be due to the fault of the cable.

The second requirement is that you know how to use the modem you use. If you do not know the commands of your modem’s command line, you will need a modem manual or a quick reference guide.

The last thing you need to know is how to set up your modem to work well with the FreeBSD system. Like other UNIX operating systems, FreeBSD uses hardware signals to find incoming connections, or to answer a call, or to reset the modem after a connection. FreeBSD avoids sending commands to the modem or checking the status from the modem. If you are familiar with connecting modems to PC-based BBSs, this can be troublesome. Serial interfaces considered

FreeBSD supports NS8250-, NS16450-, NS 16550- and NS 16550A-based EIA RS-232C (CCIT V.24) communication interfaces. Devices 8250 and 16450 have a one-character buffer. The 16550 has a 16-character buffer that increases system performance. The 16550 scheduling error interferes with the 16-character buffer, so try to use 16550A if possible. Because a one-character device buffer requires more operating system operation than a 16-character buffer, the 16550A card is more convenient and preferred. If the system has a series of active serial ports or large loads, the 16550A card is better for low transmission errors.

15.4.2. Quick overview

Below is the process by which FreeBSD proceeds to log in the Dial’up connection. The getty process started by init waits to open the specified serial port (for example / dev / ttyd0). The ps ax command should show:

4850 ?? I 0:00:09 / usr / libexec / getty V19200 ttyd0

When the user calls the modem and the modems establish a connection, the CD signal is the confirmation of the modem. Kernel will notice that the connection was discovered and getty was opened for the port. getty sends a login login line: at the specified line speed. getty checks whether the received characters are acceptable, and, in a standard configuration, if he finds garbage (probably the combination of modems has a different speed than getty), getty tries to adjust the speed so that the characters received are legible.

We hope that getty finds the correct speed and the user will see the word login:. After he has entered his username, getty will execute the program / usr / bin / login, which will perform the login asking for the password and then launch the shell.

Let’s look deeper into the configuration.

15.4.3. Configuring the kernel

A typical FreeBSD kernel is prepared to support four serial ports, known in DOS under the names: COM1 :, COM2 :, COM3: and COM4 :. FreeBSD can now also work with “stupid” multiport serial cards such as Boca Boeard 1008 and 2016 (please read the manual sio (4) to learn more about configuring a kernel with a multi-port serial card). The standard kernel only looks for standard COM ports.

To see if your kerel has recognized any of your serial ports, follow the messages during the kernel botting process, or use the / sbin / dmesg command to repeat these messages. In particular, look for lines that start with the word sio. Hint: to see only messages containing the word sio, use the command:

# / sbin / dmesg | grep ‘sio’

For example, in a system with four serial ports, these are the following ports:

sio0 at 0x3f8-0x3ff irq 4 on isa      sio0: type 16550A      sio1 at 0x2fe-0x2ff irq 3 on isa       sio1: type 16550A      sio2 at 0x3e8-0x3ef irq 5 on isa      sio2: type 16550A           sio3 at 0x2e8-0x2ef irq 9 on isa      sio3: type 16550A

If your kernel does not recognize all of the serial ports, you will probably need to create a kernel with specific parameters specifically for your hardware configuration.

Please read the BSD System Menager’s Manual chapter “Building Kernels with Config” [the text can also be found in / usr / src / share / doc / smm] and “FreeBSD Configuration Options” [z / sys / conf / options i / sys / arch / conf / options.arch with arch starting with an example from i386] to learn more about configuring and creating a kernel. Maybe you will have to unpack the source of the kernel distribution if you do not already have those sources in the * srcdist / srcsys system. ?? in FreeBSD 1.1, srcdist / sys. ?? in FreeBSD, or inside a distribution in FreeBSD 2.0) to be able to configure and create a kernel.

Create kernel configurations for your own system (if you still have one), go to the / sys / i386 / conf directory. If you create a new configuration file, copy the GENERICAH file (currently GEENRIC, or LINT) to YOURSYS, where YOURSYS is the name of your system, but written in capital letters. Edit it and change the following lines:

device sio0 at isa? port “IO_COM1” tty irq 4 vector siointr  device sio1 at isa? port “IO_COM2” tty irq 3 vector siointr  device sio2 at isa? port “IO_COM3” tty irq 5 vector siointr  device sio3 at isa? port “IO_COM4” tty irq 9 vector siointr

You can uncomment or completely delete lines for devices you do not have. If you have a multi-port serial card, such as Boca Board BB2016, read the manual sio (4) if you want to have complete information on how to enter lines for a multiport card. Be careful if you use the configuration file from a different version of the system, because the flags of the devices differ in some versions.

NOTE: the “IO_COM1” port is a substitute for port 0x3f8, IO_COM2 for 0x2f8, IO_COM3 for 0x3e8 and IO_COM4 for 0x2e8, which have common port addresses for respected serial ports; breaks 4,3,5,9 are common interrupts for the line. Thus, regular serial ports can not be used together to interrupt ISA-bus (multi-port cards have a built-in electronics, which allows all 16550A devices on the board to share one or two interruptions of the entry line).

Once you have finished adjusting your kernel file, use the config program as in the “Building Berkeley Kernels with Config” documentation and read the config (8) man to prepare the kernel structure, then create and install it, and then test it.

15.4.4. Special device files

Most devices in the kernel are available as “special device files” that are in the / dev directory. The sio device is available as user / dev / ttyd? (wdzwaniania) i / dev / cuaa? (outgoing calls). In FreeBSD version 1.1.5 and higher there are also initialization devices (/ dev / ttyid? I / dev / cuai0?) And locking devices (/ dev / ttyld and / dev / cual0). Initialization devices are used to initialize a serial port each time the port is opened, as is the crtcts command for modems that use CTS / RTS signaling to control data flow. Locking devices are used to give a blocked flag, which will protect programs or users from changing parameters, read the termios (4), sio (4) and stty (4) manhears to learn about terminal settings, Creating special device files

The shell script named MAKEDEV in the / dev directory manages special device files. To use the MAKEDEV script to create a special file for a dial’up device for COM1: (port 1) use MAKEDEV ttyd1.

MAKEDEV creates not only special devices / dev / ttyd devices? , but also / dev / cuaa? (and all files to the initialization and locking devices in the system) and removes the special file of the private terminal to rigidly (/ dev / tty0?) if it exists.

After creating new special device files, check the permissions of these files (especially / dev / cua *) to be sure that only users who should have access to them can read and write to them – most likely you will not want to allow all your users to use them Your modems to connect. Standard permissions for / dev / cua * files should be sufficient:

crw-rw —- 1 uucp dialer 28, 129 Feb 15 14:38 / dev / cuaa1  crw-rw —- 1 uucp dialer 28, 161 Feb 15 14:38 / dev / cuaia1  crw-rw —- 1 uucp dialer 28, 193 Feb 15 14:38 / dev / cuala1

These permissions allow the user uucp and other users in the dialer group to use the device.

15.4.5. Configuration file

There are three configuration files in the / etc directory that you will most likely need to modify to allow dial-up connections to your system. First, / usr / gettytab, contains configuration information for deamona / usr / libexec / getty. drugi, / etc / ttys, contains information that tells / sbin / init what device tty should have a getty process run for it. At the end, you can put the port initialization command in the /etc/rc.serial script if you have a system version or higher, or you can initialize the ports from the /etc/rc.local script.

There are two schools to configure Dial-up modems in UNIX. One group configures its modems and system so that nei does not matter with what speed the user is getting into their system, the RS-232 port interface runs with blocked speed. The advantage of this configuration is that the caller always gets a call. The problem is that the system does not know what the true connection speed is, so full-screen programs like Emacs do not extend their screen-painting methods to create better answers for lower speeds.

The second school is the configuration of your modems on RS-232 interfaces so that the basic speed depends on the remote user’s speed. The connection in the V.32bis (14.4 Kbps) standard with the modem running on the RS-232 interface at 19.2 Kbps, when the 2400bps connection runs the RS-232 interface at this speed. Because getty will not understand any particular modem connection report, getty will display the login: at the speed consistent with the initialization speed and will check the returning characters to it. If the user sees trash at home, he should pressuntil he sees the correct characters on his monitor. If the speed has not been determined, getty looks for everything that the user calls garbage, and tries to go to the next speed and display the login again:. Of course, the login sequence does not look as “clean” as in the previous method using speed blocking, but the user at lower speeds should receive better interactive responses from full-screen programs.

The author will try to give indirect information between these two methods, but he is warned to have a configuration in which the speed of modem connection depends on the connection speed. / Etc / gettytab

/ etc / gettytab is a termacap (5) style configuration file for getty information. Please see gettytab (5) in manual for complete information on this topic. Configuration with constant speed

If you block your communication speed with the modem, you probably will not have to make any changes to the / etc / gettytab file. Configuration with adjustable speed

You will have to set up an entry in / etc / gettytab to pass the getty process information about the speed you want to use for your modem. If you have a 2400bps modem, you will probably use the existing entry D2400. This entry exists in FreeBSD in the gettytab file, so you will not need to add anything unless it’s a different version of FreeBSD.

#  # Fast dialup terminals, 2400/1200/300 rotary   # (can start either way)  D2400 | D2400 | Fast-Dial-2400: \              : Nx = D2400: tc = 2400-baud:  3 | D1200 | Fast-Dial-1200: \          : Nx = D300: tc = 1200 baud:  5 | D300 | Fast-Dial-300: \            : Nx = D2400: tc = 300-baud:

If you have a higher speed modem, you’ll probably need to add an entry to the file / etc / gettyrab; below is an example of an entry allowing you to use the 14.4 Kbps modem with the upper interface set to 19.2 Kbps.

#       # Additioooons for a V.32bis Modem    #       um | V300 | High Speed ​​Modem at 300.8-bit: \           : Nx = V19200: tc = std.300:          un | V1200 | High Speed ​​Modem at 1200.8-bit: \                  : Nx = V300: tc = std.1200:          uo | V2400 | High Speed ​​Modem at 2400,8-bit: \                  : Nx = V1200: tc = std.2400:          up | V9600 | High Speed ​​Modem at 9600,8-bit: \                  : Nx = V2400: tc = std.9600:          um | V19200 | High Speed ​​Modem at 19200.8-bit: \                  : Nx = V9600: tc = std.19200:

in FreeBSD 1.1.5 and later, this entry will result in a connection to the 8-bit settings, without parity. In FreeBSD versions below 1.1, add the parameter: eg: to the entry at the beginning of the file for 8-bit, no parity, otherwise, the standard connection has 7bit parameters, parity.

The above example starts at 19.2 Kbps (for V.32bis connections), then switches to 9600bps (for V.32), 2400 bps, 1200 bps, 300bps and will return to 19.2 Kbps. Call switching is defined in nx = (“next in the array”). Each line using the entry tc = (“continuation of the table”) raises the rest from “standard” settings for a specific connection speed.

If you have a 28.8 Kbps modem and / or you want to use compression on a 14.4 Kbps modem, you will have to use higher connection speeds than 19.2 Kbps. Below is an example of entry in gettytab starting at 57600 Kbps:

#       # Additions for V.32bis or V.34 Modem         # Starting at 57.6 Kbps        #          vm | VH300 | Very High Speed ​​Modem at 300.8bit: \            : Nx = VH57600: tc = std.300:          vn | VH1200 | Very High Speed ​​Modem at 1200.8bit: \                  : Nx = VH300: tc = std.1200:          vo | VH2400 | Very High Speed ​​Modem at 2400.8bit: \                  : Nx = VH1200: tc = std.2400:          vp | VH9600 | Very High Speed ​​Modem at 9600,8bit: \                  : Nx = VH2400: tc = std.9600:          vq | VH57600 | Very High Speed ​​Modem at 57600.8bit: \                  : Nx = VH9600: tc = std.57600:

If you have a slow processor or large system load and you do not have a 16550-based serial port, you can receive sio “silo” errors when connecting 57.6 Kbps. / Etc / ttys

/ etc / ttys is the ttys list for init for monitoring. / etc / ttys also provides secure information to login: (the root user can log in only to ttys marked as secure). See manual ttys (5) for more information.

You will have to modify existing lines in / etc / ttys beforehand or add a new one so that init can start the getty process automatically for the new dial-up port. The general format of the line will be the same, whether you use the blocked speed or set in the configuration:

ttyd0 “/ usr / libexec / getty xxx” dialup on

The first attribute at the beginning of the line specifies the special device, for this entry – ttyd0 means / dev / ttyd0 is the file that getty will follow. The second attribute, “/ usr / libexec / getty xxx” (xxx is repeated in the gettytab initialization settings) is an init process run on the device. The third attribute, dialup, is the standard terminal type. The fourth parameter, on, indicating init that this line is optional. There may also be a fifth parameter, secure, but it should be used only for physically safe terminals (like a console).

The standard type of terminal (dialup for the above example) may differ in local preferences. dialup is a traditional standard type of terminal for a dial-up line, so users can create their own script with settings to see that the terminal is as dialup and automatically change it to another type. Although the author has found a more convenient way, his site sets vt100 as a standard terminal because users use VT100 emulation on their remote systems.

After you make changes to / etc / ttys, you will have to initiate the HUP signal to init, so that it can read the settings in the file again. You can use the command:

# kill -HUP 1

to send this signal. If this is the first time you change the system settings, you may have to wait until your modem is properly configured and connected before you send HUP to init. Configuration file with blocked speed

For a speed-locked configuration, your entries in ttys will need an entry with the correct speed to deliver it to getty. For a modem whose speed on the port is blocked at 19,200 Kbps, the ttys entry should look something like this:

ttyd0 “/ usr / libexec / getty std.19200” dialup on

If the modem is blocked on a different data transfer speed, replace the std.19200 entry corresponding to the speed according to schamatu std.speed from / etc / gettytab. Configuration with adjustable speed

In the configuration with the set speed, your ttys entries will require the proper start of the “auto-baud” (sic) entry in / etc / gettytab. For example, if you add the above entries for modems with a negotiated speed which starts from 19.2 Kbps (entries in gettytab contain the starting point on V19200), your ttys should look like this:

ttyd0 “/ usr / libexec / gettty V19200” dialup on /etc/rc.serial or /etc/rc.local

High speed modems, such as V.32, V.32bis and V.34, require the use of hardware data flow control. You can add the stty command to /etc/rc.serial in FreeBSD and above or in /etc/rc.local in FreeBSd 1.1 to set the hardware data control flag in the FreeBSD kernel for the modem port.

For example, in FreeBSD, /etc/rc.serial reads:

#! / Bin / sh  #       # Serial port initial configuration           stty -f / dev / ttyid1 crtscts         stty -f / dev / cuai01 crtscts

These crtscts flag settings for termios first serial port (COM2 🙂 are for the initialization of dial-in and dial-out devices.

On older systems like FreeBSD 1.1, we added these entries to /etc/rc.local to set these flags on the device as crtscts:

# Set serial ports to use RTS / CTS flow control      stty -f / dev / ttyd0 crtscts          stty -f / dev / ttyd1 crtscts          stty -f / dev / ttyd2 crtscts          stty -f / dev / ttyd3 crtscts

Since there are no special device files in FreeBSD 1.1, one simply simply sets the flags on the devices, and it is to be hoped that they will not be changed.

15.4.6. Modem settings

If you have a modem that allows for permanent parameter settings in an unstable RAM, you will need to use a terminal program (such as Telix for PC-DOS or the tip under FreeBSd) to set parameters. Connect the modem using the same initial speed as using getty and configure the modem’s RAM in accordance with the following requirements:

  • provide a CD when connected
  • provide a DTR for operations; dump DTR and reset the modem
  • control of data flow through CTS
  • block the flow control of XON / XOFF
  • RTS receives data flow control
  • without the echo command

Please read the documentation for your modem to find the commands and / or jumpers that are used for this.

For example, to set the above settings on the USRobotics Sportster 14,400 modem, one of the possibilities is to enter such a command into the modem:

ATZ     AT & C1; & D2 & H1; & I0; & R2; & W;

You will probably also need to do this to change other settings in the modem, such as when you want to use V.42bis and / or MNP5 compression.

The Sportster 14,400 external USR modem also has several jumpers that need to be adjusted, for other modems you can use the following example:

– Switch 1: Top – DTR Normal  – Switch 2: Invalid (Verbal Result Codes / Numeric                     Result Codes)  – Switch 3: Top – Suppress Result Codes  – Switch 4: Down – No echo, offline commands  – Switch 5: Top – Auto Answer  – Switch 6: Top – Carrier Detect Normal  – Switch 7: Up – Load a standard NVRAM  – Switch 8: Invalid (Smart Mode / Dumb Mode)

The display of the resulting code should be blocked for dial-up modems to avoid problems that may occur when getty will erroneously give the login line: to the modem, it is on the command line and the modem will display an echo or return the result code. I heard that such a sequence can lead to a “silly” conversation between getty and modem. Configuration file with blocked speed

For a speed-locked configuration, you will have to configure the modem to maintain a constant data rate between the modem and the computer, independent of the speed of communication between them. In the external ODR Sportster 14,400, the following commands will block the speed of data transfer between the modem and the computer to the size specified in the command:

ATZ     AT & B1 & W; Configuration with adjustable speed

For multi-speed configurations, you will have to configure your modem so that it increases the speed on the serial port to the size with which it receives data. In an external USR Sportster 14,400 modem, the following commands block modem errors, the correct data transfer speed is included in the command, but the permissible serial port speed will be adapted to the error free connection.

ATZ     AT & B2 & W; Checking the modem configuration

Most modems that offer us higher speeds have commands that allow us to check the current modem operating parameters, in human-readable form. In the external USR Sportster 14,400 modem, the ATI5 command will display the settings that are stored in the unplaced RAM. To see the real operational parameters of the modem, enter the command ATZ and then ATI4.

If you have a third-party modem, check your modem’s instructions on how to double check the modem configuration parameters.

15.4.7. Troubleshooting

Below are some tips on how to check your modem. Check your system

Connect your modem to a computer with FreeBSD, run it, and if the LEDs (DST and PWR) light up on the modem, see if the DTR LED is on when the login appears on the console:. If it lights up, it means that the system has launched the getty process and prepared the communication port and waits for connection with the modem.

If the DTR LED did not come on, log in to the console and enter the ps ax command to see if the system is trying to start the getty process on the correct port. You should see lines like below from the following:

114 ?? I 0: 00.10 / usr / libexec / getty V19200 ttyd0  115 ?? I 0: 00.10 / usr / libexec / getty V19200 ttyd1

If you see something else like, for example

114 d0 I 0: 00.10 / usr / libexec / getty V19200 ttyd0

and the modem will not accept the connection, it means that the getty process is running correctly and waiting for the communication port to open. This will probably be a problem with the cable or modem configuration, because getty is unable to open the communication port until CD (Carrier Detect) has been asserted by the modem.

If you do not see any getty process waiting to open the designated ttydX port, check the entries in / etc / ttys again or make some mistakes there. Also check the file with logs (/ var / log / messages) or have some init or getty entries that specify the problem. If there are no logs there, check again / etc / ttys and / etc / gettytab whether the required ttydX special device files are typed correctly, or you have not committed any other typos. Try to make a call

Try to call the system, make sure you have: 8 bits, no parity, 1 stop bit, on the remote system. If you do not receive the prompt, or you get “ trash ”, try to pressonce a second. If you still do not see the login line: after a moment, try sending a BREAK signal. If you are using a fast modem to call, try to connect again by blocking the modem interface speed (via AT & B1 for the USR Sportster modem for example).

If you still do not see the login: line, check the contents of the / etc / gettytab file again paying attention to

The initiation name listed in / etc / ttys matches the same line in / etc / gettytab

Each entry nx = matches another name from gettytab

Each entry tc = matches other names from gettytab

If you are calling and the modem on the FreeBSD system is not responding, make sure that the modem is configured to respond to the telephone when the DTR signal is provided. If I can look configured correctly, check if the modem gets a DTR signal by checking if the correct LED is on the modem (if the modem has some).

If you’ve already checked everything a few times and you still can not get into the phone, take a break and try again later. If this does not help, maybe you should send a mail to the main FreeBSD newsgroup describing your modem and problem and good people on the group will try to help you somehow.

15.4.8. thanks

Thank you to these people for your comments and advice:

Sean Kelly,
for a lot of good suggestions

15.5. Dial-out Service

Information merged FAQ.

Below are hints that your computer will be able to connect using a modem with another computer. They are suitable to establish a terminal session with a remote host.

This is useful for logging into the BBS.

This type of connection can be extremely helpful when downloading files from the Internet if you have problems with PPP. If you need something from FTP and you do not have an FTP connection, use the terminal session. Then use the change to send them to your computer.

15.5.1. Why can not I run a tip or a cu?

On your system, probably the tip and cu programs have execute rights only for the uucp user and the dialer group. You can use this group to control who can use your modem or remote systems. Just add your user to the drupa dialer.

You can also give all users the option of running the tip and cu programs by entering:

# chmod 4511 / usr / bin / tip

You do not have to issue this command for cu, because cu is just a link to the tip program.

15.5.2. My spare Hayes modem has no support, what can I do?

Currently, the manual page for the tip program is out of date. The general dialer is already built-in. Just use the command at = hayes in your / etc / remote file.

The driver for Hayes is not extensive enough to recognize some of the more advanced messages from the modem like BUSY, NO DIALTONE or CONNECT 115200 and just reject them. You should disable these messages when using the tip program (using ATX0 & W).

So, exceeding the connection time for the tip is 60 seconds. Your modem should use something smaller, otherwise the tip will inform you about communication problems. Try ATS7 = 45 & W.

Currently, as a tapped tip, he does not have full support. The solution is to edit the tipconf.h file in the /usr/src/usr.bin/tip/tip directory. Of course you need distribution sources.

Change lines #define HAYES 0 to #define HAYES 1. Then execute the make and make install commands. Everything will work better after doing this.

15.5.3. How do I expect to enter these AT commands? 
Do what is called “ direct ” in your / etc / remote file. For example, if your modem is connected to the first communication port, / dev / cuaa0, put it in the line:

cuaa0: dv = / dev / cuaa0: br # 19200: pa = none

use the maximum bps size that your modem supports in the variable br. Then, type tip cuaa0, so that you connect to the modem.

If there is no / dev / cuaa0 device in your system, do the following:

# cd / dev      # MAKEDEV cuaa0

Or use root with the following options:

# cu -lline -sspeed

line is a serial port (eg / dev / cuaa0) and speed is the speed (eg 57600). When you finish entering AT commands, type ~. to get out of the room.

15.5.4. The @ sign for the variable pn does not work!

The @ sign when specifying a telephone number variable (phone number or pn) tells the tip program to check the / etc / phones file for this number. Unfortunately, @ is also a special character in variable files such as / etc / remote. To use it you have to precede it with backslash:

pn = \ @

15.5.5. How can I dial a phone number from the command line?

Enter what is named “ generic ” in the / etc / remote file. For example:

tip115200 | Dial any phone number at 115200 bps: \              : Dv = / dev / cuaa0: br # 115200: at = hayes: pa = none: du:      tip57600 | Dial any phone number at 57600 bps: \              : Dv = / dev / cuaa0: br # 57600: at = hayes: pa = none: du:

Then you can enter:

# tip -115200 5551234

If you prefer cu from tip, use the standard cu entry:

cu115200 | Use cu to dial any number at 115200bps: \              : Dv = / dev / cuaa1: br # 57600: at = hayes: pa = none: du:

and then:

# cu 5551234 -s 115200

15.5.6. Do I have to enter the bps speed each time?

Put it in the entry for tip1200 or cu1200, but go forward and use the appropriate br value for each speed bps. For the tip, the default speed is 1200 bps, whose entry with the settings is searched for. You can not use 1200bps after all.

15.5.7. Can I pass the host number directly to the server terminal?

More eagerly than to wait until you connect and enter CONNECT every time, use the cm value for the tip. For example, these entries in / etc / remote:

pain | | Forrester’s machine: \      : cm = CONNECT pain \ n: tc = deep13:  muffin | | Frank’s machine: \      : cm = CONNECT muffin \ n: tc = deep13:  deep13: Gizmonics Institute terminal server: \      : Dv = / dev / cuaa2: br # 38400: at = hayes: du: pa = none: pn = 5551234:

they will allow you to type tip pain or tip muffin and connect to these hosts; and tip deep13 to get to the server terminal.

15.5.8. Can a tip try more than one line for each page?

This is a common problem when the university has several modem lines and several hundred students trying to connect …

Create an entry for your university in / etc / remote and use @ as the value of pn:

big-university: \              : Pn = \ @: tc = dialout      dialout: \              : Dv = / dev / cuaa3: br # 9600: at = courier: du: pa = none:

Later, put a list of phone numbers for the university in the / etc / phones file:

big-university 5551111      big-university 5551112      big-university 5551113      big-university 5551114

tip will try every phone from the list and then it will end. If you want to keep trying to connect, start the tip in the while loop.

15.5.9. Why do I have to press CTRL + P twice to send a single CTRL + P?

CTRL + P is the standard “ enforcing ” character used to inform the tip that the next character is given. You can set a mandatory character for any other character using ~ s escape, which means “ set variable ”.

The type ‘sforce = single-char’ is the new line. single-char is a single sign. If you are excluding single characters, then the force character is an empty character, which you can get using CTRL + 2 or CTRL + SPACEBAR. A good value for a single character is SHIFT + CTRL + 6, which is used in some terminal servers.

You can set a mandatory character to whatever you want by defining it in the $ HOME / .tiprc file:

force =

15.05.10. Suddenly, everything I type is written in BIG LETTERS ??

You must use CTRL + A, “ raised characters ” have been designed for people with a broken caps-lock key. Use ~ s as above and set the raisechar variable to match you. Of course, you can set it the same as the forcing sign, if you think you will not use any of them. YOU must have pressed CTRL + A, tip’s “ raise character, ” specially designed for people with broken caps-lock keys. Use ~ s as above and the variable raisechar to be pretty. In fact, you can set it to be the same as the force of nature.

Here is a simple .tiprc file perfect for Emacs users who often use the combination of CTRL + 2 and CTRL + A:

force = ^^      raisechar = ^^

^^ matches the SHIFT + CTRL + 6 combination.

15.05.11. How can I use the tip for file trancfer?

If you are talking to another UNIX system, you can send and receive files using ~ p (drop, send) and ~ t (accept). These commands run cat and echo on the remote system to receive and send files. The syntax is:

~ p local-file [remote-file]    ~ t remote-file [local-file]

Unfortunately, there is no bug checking here, so you probably should use a different protocol, like using a change.

15.05.12. How can I run with a change from the tip?

To receive the file, start the sending program at the remote end. Then enter ~ C rz to start receiving them locally.

To send files, start the receiving program at the remote end. Then enter ~ C sz files to send them to the remote system

Getting Started with FreeBSD Operating System


The process of starting the computer and uploading the operating system is called the bootstrap process or simply boot. Running FreeBSD is characterized by very high flexibility and configurability. For example, it lets you choose which operating system you want to run if you have several. It even allows you to choose the version of the same system, or decide which system kernel to run.

This chapter discusses in detail the configuration options as well as how to personalize the FreeBSD boot process. It includes everything that happens before the system kernel is started, device detection, init (8). If you’re not sure when it’s happening, know that when the text color changes from light white to gray.

After reading this chapter, you should know:

  • What happens and how elements of FreeBSD startup processes interact with each other.
  • What FreeBSD startup options can be set.

X86 only This chapter describes only the startup process of FreeBSD operating on Intel x86 architectures.

Problem with running

Turning on the computer and starting the operating system shows an interesting problem. By definition, the computer does not know how to do it until the operating system is started. Of course, this includes running programs from the disk. So if the computer can not enable programs from the disk without the operating system, and the operating system programs are on the disk, how does the system boot at all?

In the early years of computerization, the term “bootstrap” was used to describe the mechanisms that run the operating system. This term, through evolution, has been shortened to “booting”.

On x86 hardware, it is the BIOS (Basic Input Output System) that is responsible for starting the operating system. To do this, the BIOS checks the MBR (Master Boot Record) of the disks. The BIOS is skillful enough to be able to load and run MBR content. Then, starting by the MBR, the system startup mechanisms are started.

If you only have one operating system on your disk, a standard MBR is enough. MBR searches for the first bootable partition on the disk, then runs the code contained on this partition to load the operating system.

If you have several operating systems on your disks, you can install another MBR, one that will display a list of available operating systems, and then allow you to choose between them. FreeBSD can be installed with just such MBR. Providers of other operating systems often offer an alternative MBR.

The FreeBSD startup process is divided into three parts. The first of these is the launch of the MBR, which knows as much as putting the computer in a specific state and starting the next, second stage of commissioning. This next stage is able to do a little more before starting the third stage. The last, third stage of loading the operating system, completes the entire procedure. The entire task of starting the system is divided into three parts, because the standards of personal computers impose restrictions on the size of programs that are executable in the first and second parts. FreeBSD connection allows you to get more flexible system uploads.

When the system kernel is started, it starts to detect the devices and tries to start them. When the kernel boot process is finished, the kernel passes control to the init (8) process, which makes sure that the disks are in good condition. Then init (8) starts the configuration of the user who mounts the hard disks, sets the network adapter configuration to be able to communicate with the network, then generally starts all processes that are run on FreeBSD startup.

MBR and start stages I, II, III.

MBR, / boot / boot0

MBR FreeBSD is located in / boot / boot0. This is a copy of a real MBR, because this one must be in a special part of the hard disk, outside the FreeBSD partition area.

boot0 is very simple, because the program residing in the MBR can have only 512 bytes. If you installed MBR with FreeBSD, you have several operating systems, then you will see a similar shot when you start the operating system.

Example - boot0
F2 FreeBSD
F3 Linux
F4 ???
F5 Drive 1

Default: F2 (default option)

Some operating systems are known to overwrite the MBR. Such a system is for example Windows 95. If such an event occurs, or you want to replace an existing MBR with a FreeBSD MBR, you can use the following command.

# fdisk -B -b / boot / boot0 device

Where device is the disk from which you are booting the system, such as ad0 is the first IDE drive and ad2 the first IDE drive on the second controller. da0 is the first SCSI disk, etc.

If you are a Linux user, you prefer to use LILO to control the startup process, you can edit the
/etc/lilo.conf file. You can declare “Leave MBR unchanged” [“Leave the MBR untouched”] during the system installation process. If we have declared so, we can run linux, then edit /etc/lilo.conf by adding:

other = / dev / hdXY
table = / dev / HDB
loader = / boot / chain.b
label = FreeBSD

This will allow LILO to run both Linux and FreeBSD. In our example, we use XY to specify the drive and partition number. If you’re using a SCSI drive, you’ll probably want to change / dev / hdXY to / dev / sdXY, where the XY symbols have the same meaning.

The loader = / boot / chain.b option can be omitted if you have both operating systems on the same drive. You can now run / sbin / lilo -v to save changes, this should be verified with messages displayed on the screen.

Stage I, / boot / boot1, stage II, / boot / boot2

Deliberately elements of stages I and II are parts of the same program on the same part of the disk. Because the space is limited, it has been divided into 2 parts, but you will always install them together.

Elements I and II can be found in the boot-sector of the partition being started, i.e. where boot0 or any other MBR programs are waiting to find a program that will continue the boot process. The files in the / boot directory are only copies of the real ones that are outside the FreeBSD partitions.

boot1 is very simple. It can be up to 512 bytes in size, and it only knows about disklabel ( diskette label where information about the partition is stored) and how to find and run boot2.

boot2 is already more sophisticated and can understand the FreeBSD file system enough to be able to find the files on it and display a menu to select the system kernel or loader.

While the loader loader is even more extensive and provides an easy-to-use system boot configuration, boot2 usually launches the loader, before launching the kernel directly.

   Example. boot2 screenshot
    >> FreeBSD / i386 BOOT
    Default: 0: ad (0, a) / kernel

If you ever need to replace boot1 and boo2, use disklabel (8).

FreeBSD # disklabel -B diskslice

Where diskslice is the disk and partition from which you boot the system, for example ad0s1 is the first partition, the first IDE disk.

Dangerously dedicated mode: If you only use the disk name, such as ad0, in disklabel, you will create a dangerously dedicated disk, without a partition. This is probably not what you wanted to do, so make sure you double check the disklabel (8) command syntax before you press Enter.

Stage III, / boot / loader.

Loader is the last part of the three-way startup process. It is already located in the file system, usually in / boot / loader.

The Loader loader is seen as a user-friendly tool that has a large number of built-in functions, supported by a built-in interpreter with a fairly complex syntax.

Operation of the loader

During initialization, the loader will attempt to detect the console and disks to find out which disk the boot runs from. Then the appropriate variables will be set, then the interpreting program is started, where the user’s commands (derived from scripts or interactive) are already recognized.

Then the loader reads /boot/loader.rc, which by default reads
/boot/defaults/loader.conf, setting the correct default settings, then reads /boot/loader.conf to replace the default variables with local variables. loader.rc is working on these variables, loading the selected modules and the kernel.

Finally, in the default configuration, the loader waits 10 seconds for the key to be pressed. Then it starts the kernel if no key is pressed. If the countdown time is interrupted, the user will be familiar with the prompt where you can give the loader easy-to-use commands. For example, you can fine-tune variables, unload all loaded kernel modules, load modules, eventually start the computer, or restart.

Commands built into the loader

Below are the most commonly used loader commands. If you would like to see a complete list of functions, please see the man page for loader (8).

autoboot seconds

It intends to run the kernel at a given time, unless it is interrupted. Displays the countdown. The default time is 10 seconds.

boot [-options] [kernel name]

Immediately starts the kernel with given options, if there are, with a kernel with that name, if it exists.


goes through the same automatic configuration of modules based on variables, as was the case at startup. This only makes sense if you use the unload command before. Then the variables change, most often the nucleus.

What is FreeBSD?


FreeBSD is an operating system based on 4.4BSD-Lite. It is designed for Intel (x86) architecture and DEC Alpha architectures.

What can FreeBSD do?

Freebsd has a lot of advantages. Here are some of them:

  • Multitasking – with dynamic priority tuning to ensure that your applications and users can share your computer efficiently, even when the system is heavily loaded.
  • Multi -user – allows multiple users to share a computer with FreeBSD at the same time. This means, for example, that printer-type devices, drives can be used by many network users, and it is possible to restrict selected users / groups access to certain services, which helps to eliminate the problem of system overload.
  • Networking – excellent TCP / IP solutions with support for SLIP, PPP, NFS, DHCP and NIS. This means more or less that FreeBSD can easily cooperate with other operating systems as well as play the role of a server in a large organization, providing services like NFS, mail, and going to the world – to the Internet: www, ftp, routing u) packages or security – firewall.
  • Memory protection – guarantees that applications or users can not interfere with others. In other words, a user’s program failure will not affect the operation of the system for other users in any way.
  • 32-bit – FreeBSD is a 32 bit system (64 for Alpha architecture).
  • X Window System – has a graphical user interface cooperating with the majority of popular graphics cards and monitors.
    Compatibility – has the ability to run programs compiled for Linux, SCO, SVR4, BSDI and NetBSD.
  • Readiness – has thousands of ready-to-use applications. All this is available in the collection of ports and packages. There is no need to search the web, everything can be found there.
  • Add – ons – thousands of easy-to-install applications. FreeBSD is compatible with most UNIX systems, so small code corrections are enough to properly compile and run a program dedicated to other systems.
  • Virtual memory – and a shared “VM / buffer cache” designed to simultaneously efficiently satisfy applications with a high appetite on memory, as well as interact with other users.
  • SMP – support for machines with multiple processors.
  • C, C ++, Fortran, Perl – complete environments. In addition, the possibility of installing many, many others thanks to the collection of ports.
  • Source code – available for the entire system, and thus you get excellent control over the whole environment. Why be condemned to the system provider when you can have a truly open system?
  • Documentation – online system documentation is still being expanded.
  • And many others!

FreeBSD is based on the 4.4BSD-Lite system from the Computer Systems Research Group (CSRG) of the University of California, Berkeley. It maintains the distinguished tradition of the development trend of BSD systems. After the excellent work done by CSRG, many thousand hours were spent on FreeBSD to improve it and prepare for life’s difficult situations. If you ask for an operating system with great achievements and a system that you can rely on – the answer is one – FreeBSD.

The number of applications that can be used by FreeBSD is limited only by your imagination. From programming software, through automation from factories, accounting, to azimuth control of a satellite dish – all of this can be done not only in commercial versions of Unix, but also in FreeBSD. He himself is supplied from day to day with an increasing number of free, but perfectly polished applications, often coming from university development centers. There is also the possibility of acquiring commercial software, the number of which is growing as fast as free software.

As the FreeBSD source code is made public, the system can be tuned for many specialist projects and applications, which is generally not feasible for commercial systems. Here’s a small list of applications that FreeBSD is most often used with:

  • Internet services: excellent TCP / IP support embedded in FreeBSD, makes us an ideal platform for a number of Internet services, for example:
    • FTP servers;
    • World Wide Web servers (standard or SSL encrypted);
    • Firewall and NAT gateways (IP Masquerading);
    • E-mail servers;
    • USENET servers;
    • and other…
  • Education: Are you an IT student? There is no better way to get to know the operating system, computer architecture and network issues. A large number of free CAD, mathematical and graphic programs will be very useful for those whose most important interest is to do the work on the computer.
  • Discoveries: With available source code for the entire system, FreeBSD is an excellent platform for searching for new solutions related to operating systems and other computer science industries. The open source idea also supports entire groups cooperating remotely over various tasks, helping them to forget about problems related to special license terms and restrictions.
  • Network: Do you need a new router? Name server (DNS)? Firewall to beware of unauthorized users? FreeBSD can easily replace a useless 486 or even 386, standing in a corner, into an advanced router with sophisticated packet filtering options.
  • The graphical environment: FreeBSD is a good choice when it comes to the X Window environment. You can choose between the free XFree86 server or one of the commercial applications. Inexpensive is the X terminal solution, where only one central machine must be strong, and the other can even be diskless, which, of course, simplifies administration.
  • Programming: The FreeBSD system is equipped with a full set of programming tools, including, for example, a refurbished compiler and a GNU C / C ++ debugger.

Who uses FreeBSD?

FreeBSD is used to serve many of the largest websites, including:

  • Yahoo!
  • Apache
  • Be, Inc.
  • Blue Mountain Arts
  • Pair Networks
  • Whistle Communications
  • Microsoft
  • Hotmail
  • Sony Japan
  • and many others.

Based on

How to Choose the Best Web Hosting?


In this article I will help you find the best web hosting for your personal blog or business website. If you are looking for the best web hosting, please read this article. Here you will find very useful tips on how to choose a reliable hosting service. I’ve also included reviews of my favorite hosting providers at the end of this article.

Nowadays, if you are a head of a company that doesn’t have online presence, then you should seriously consider your business model. People buy lots of stuff online and if you don’t show your services and products to them via a neatly designed website, then you are simply losing money.

Even if you are leading a traditional business, wouldn’t it be nice if people find your site on the Internet? They either locate and go to your store or look up your number and call you to demand your service; in the end it’s great for your business in both ways.

What most of us do when we need something is that we sit down to our laptop or pick up our phones and use search engines to find us the store and agency we need. That’s how new customers find your business. Don’t make it difficult for them to find you, launch your website instead.

But first, you need to pick the web host that mostly suits your needs. These are companies that secure a reliable service for you by storing your content on their servers and making it accessible to anyone who wants to see your site.

Choosing between these web hosting providers can be a tricky question. The services and prices can differ in many ways, so it’s important to gather information first and consider your business goals before you make your decision.

Free hosting services are also an option, but then your website will be full of ads which can be quite annoying for you and your viewers as well. If you want to be able to fully control and uniquely present your content, you should definitely try a premium option.

Now let’s dive into the world of web hosting and go through the most important points.

Start with Shared Hosting

A dedicated server is often too expensive or simply too much for your needs. You don’t necessarily need a whole server for your site if there are some decent providers available that offer plans for shared hosting as well. It’s a perfect option if you are not familiar with web hosting services and want to launch your first website.

It’s a pretty good choice if you want to keep a tight budget, as these usually cost around $5 each month. You won’t get as much control by renting a shared server as with the dedicated or VPS one, but those cost hundreds of dollars, so it’s a completely different category.

Many shared hosting providers offer dedicated hosting as well and vice versa. You can consider their shared hosting plans an opportunity to test their services. Most of these offer quite generous money back guarantees as well, giving you some space to change your decision without any investment.

However, if you want to start small and their services are satisfying to you, then you should invest in one of their longer plans since you will get a significant discount. Even if you have enough money for a dedicated server, it’s hard to tell right away whether you need that big of a storage or not.

Not to mention the various professional features and control that you get for your money. The reason why shared hosting is such a smart idea is that you can start off with your first website while many other users have their own smaller sites on the same server.

They all pay for the hosting, keeping it really cheap while the server can still run easily without complications. On the other hand, shared hosting really pays off for the providers since there are always users who will demand their dedicated hosting service as well in the future.

Test Customer Support

It can happen at any time that you’re working on your website, suddenly run into a problem and you just don’t know how to solve it. Without a customer support, it can be really hard to find a proper fix. Of course, not everyone is a skilled IT guy, so you need to find one as soon as possible.

This is why making sure that a web hosting service has a helpful and responsive customer support is so crucial. After starting a new website, it needs to be somehow guaranteed that it won’t crash or let you down in any way in the long run.

A quick helping hand, a powerful community or at least a comprehensive knowledge base has to be available at all times at a hosting provider if they want to call themselves a whole. By paying for their services, you are a customer that deserves that attention.

There are many hosting companies that happily accept your money, but still only spend the bare minimum on their customer support section. When you start searching for potential web hosting providers, you should check their knowledge base and forums.

If you mostly see low scores and complaints about their customer support or even additional signs that indicate unsolved customer issues, then you should certainly choose another company instead. An unresponsive team can quickly earn them a bad reputation.

On our list of web hosts, you can find some of the biggest names with customer supports you can actually count on. You can tell if a provider properly invests in helping out their clients and keeping up a support that is constantly available. It’s like an indicator that shows whether we are talking about a serious team or not.

When looking for the best web hosting provider, make sure that they care about your success and not just your money.

Research Reliability & Uptime

These are two additional reasons why you should read more about web hosting options before making a choice. It’s easy to give your money to a provider just because they offer a plethora of awesome extras for low prices, but what if you suddenly start experiencing unexpected issues that only hinder your progress?

You need to consider the current budget that you are willing to invest and how much uptime and reliability does it equal to. If you want cheaper options, you can find them right away and they will get you online as well, but don’t be surprised if their servers are bad and they barely offer any support.

No need to worry, there are numerous web hosts available that are affordable and reliable. There are even big names with many years of experience that offer shared hosting options with outstanding uptime stats and tons of satisfied customers.

When it comes to reliability, there are some really important factors to consider. Firstly, a reliable provider should be financially strong and equipped with a top-notch hardware. Also, most of them keep track of their uptime from the year they started and if you see a number there that is more than 99%, then you are fine.

A good web hosting service needs to be secured physically as well and to have a disaster recovery plan that guarantees your data back even if something critical happens. You can expect all this information to be written on a web host’s website so you can get more familiar with their offers and decide whether to join or not.

We are going to show you three greatly successful web hosting providers that already have a long track record of success. They offer the highest possible uptime and you can count on them at any time.

Analyze Guarantees, Policies & Terms

When checking a particular host, always look for the guarantees section and take a look at their list. It usually emphasizes their money back guarantee, which is great, and also their high uptime stats. These are two of the most essential guarantees you look for.

Of course, money back guarantees can vary between 7 and 90 days, but we can say that most web hosts refund within 30 days which is solid. Other than that, you should look for web hosts that guarantee their uptime and a 24/7 support, and both of these are crucially important for maintaining a serious website.

Additionally, a good provider has to make it clear that they store your data securely and won’t use it in any way. Their terms and conditions need to be stated clearly in a separate document or page and also add a glossary where you can find the meaning of unfamiliar words.

Make sure that they have a proper backup so you can lie back confidently knowing that your content won’t be lost even if the servers accidentally crash during your work. You can also read more about the infrastructure of web hosts to ensure yourself that your data is safe and secured.

Best Web Hosts for Beginners & Small Businesses

There are too many hosting companies you can choose from. I’ve tried many, and I always like to go with the best, even if they might be a little bit more expensive. But how expensive can get a reliable hosting service? Actually, professional web hosting is not expensive. Indeed, some of the top and most reliable hosting providers offer their starter packages for under $5 / month.

Do you think it is hard to find a good hosting? I will help you to choose the best web hosting. Bellow you can find a quick overview of my favorite hosting providers that I use all the time:

1. BlueHost


If you search for web hosting providers on Google, BlueHost will be one of them that immediately pop up in the results. They started with shared hosting back in 1996, but now you can choose WordPress hosting, VPS and dedicated servers as well.

BlueHost keeps up a really high standard when it comes to their services, no wonder that they were the winning choice for millions of website owners. They greatly improved their services especially in the past few years, ensuring a great user experience even for the complete beginner.

As a highly successful hosting provider, BlueHost is also recommended by the WordPress team. You can add their platform in just a few simple steps, straight from your control panel.

Thanks to their fast servers that they recently upgraded to top-notch machines, your website will load quickly and seamlessly, providing you with a surprisingly good performance as a shared host. There are three different plans available with BlueHost and the prices vary according to how many add-on domains you want.

Unless you want to run several websites effectively at the same time, you should pick either the Basic or the Plus package and end up paying under $6 a month. For more demanding users, there is the Pro package that jumps up to $14.

In case you are experiencing any difficulties, they can be reached by phone, chat, and through email. You can message them whenever you want and they will answer and solve any of your site-specific or tech issues within an hour.

Instead of being too technical, they focused on providing services that are straightforward and suitable for beginners who just want an easy and reliable solution. Considering their prices and that we are talking about a very competitive company, we can say that investing in BlueHost services is a smart choice and you will definitely not regret it.

2. InMotion Hosting


InMotion is another one of the most comprehensive web hosting providers that are currently available. Their services rely on the latest hardware, well-organized and fast support, and many options to choose from depending on your hosting needs.

They started back in 2001 and slowly but surely evolved into a huge company that easily receives the highest scores in most reviews. You can expect a whopping 99,99% uptime by them which can’t be beaten by most other providers.

InMotion also guarantees faster loading times for your website than most of their competitors, gaining significant advantage with their SSD hard drives, a technology that takes data transfer to another level.

There are always top providers who suddenly decide that it’s okay to overbook their servers and allow more websites on them than recommended, hoping that there won’t be a traffic spike on too many sites simultaneously.

Although this boosts their income, it causes some really awkward situations. InMotion never does that, so your website will surely work seamlessly even in days of heavy traffic. They are also really generous, since you can have your money back thanks to their 90-day refund, which is ridiculously big compared to the 30-day average.

They offer free backup, which is another awesome thing because other web hosts usually charge some money for restoring your data. On the other hand, they clearly invest huge amounts of money in providing a decent support which shows that they indeed take their business seriously.

If you are looking to start a Joomla website, or a WordPress blog, with InMotion you can set it up quickly. They offer one-click installation tool, which enables you to choose from over 150 open source software and install them to your website.

InMotion is really responsive through all of their channels when it comes to customer support and their professionals are highly experienced in their field. If you want to just read more into a particular subject, they have a pretty impressive knowledge base with plenty of conversations that can be helpful to you.

If you want to launch and maintain a few websites, InMotion can certainly provide you with top-notch hosting services. This site is actually hosted on InMotion Hosting.

3. HostGator


This provider is launched in 2002 and quickly proved itself as a powerful solution for website hosting. They have a specific plan that lasts 36 months, costing only $4 each month which is a nice offer for those who want to use HostGator long term.

You can save up to 85% with HostGator if you provide one of the best HostGator coupons at the checkout.

And they indeed include a plenty of extras for that money. You can rely on their user friendly site management options that are completely based on cPanel, and if you need a CMS, you can also add WordPress with a single click.

They secure you unlimited storage, bandwidth, email accounts and much more. Their servers are up 99,99% of the time, which is in accordance with the latest standards.  Their plans are rather realistic, as you don’t get any unreasonable limitations with the basic pan that might force you to upgrade.

HostGator integrated more than enough options in their dashboard, which can be confusing but it comes with the benefit that you can set up everything at one place. For example, you can set up the domain email address right away.

You will get a simple website builder with around a 100 themes that have the HostGator logo, in case you are in a hurry and just want to build up a small website for starters. The provider has tons of support articles available and you can find them either on their portal or through cPanel.

It’s a very smart system since you only need to type in a few words and it will find you the most useful texts related to the topic. If you get stuck, there are always some professionals available at their live chat that is eager to help.

The prices at HostGator are obviously a bit higher than the average, but considering their set of features it’s really not that much. They are actually a great choice for those who want some extras.


If you want to end up with a website hosting service that truly suits your needs, there are a few important points you should consider. Firstly, imagine the website you want to build and gather enough information about each provider. Look for the features that are mostly aligned with your goals.

Also, don’t forget to check the uptime and reliability of their servers. Ideally, you shouldn’t accept a service with less than 99% uptime because you can easily find a better option anyway. The prices for shared hosts generally vary around $5, but if you see one with plans that are above $10, then don’t even bother trying it.

As a beginner, it’s recommended to get familiar with managing a website and accumulating traffic before you consider using a dedicated server or VPS. If you are doing it right, you will eventually need to invest in a more serious website anyway.

The three hosting providers we reviewed are not expensive and you surely get plenty of support, satisfying uptimes, decent loading speeds and you can maintain a couple of websites at the same time. It’s totally worth it for small businesses, personal websites or even just studying CMS and web design.