cmos" -- Device Driver" "

Device for reading CMOS

The file /dev/cmos the entry via which you can read your system's CMOS. It is a part of the driver mem, which manages memory; thus, it has major number 0 and minor number 3.

The CMOS is a special, non-volatile area of random-access memory (RAM) that holds information about your system's configuration. The following gives the common meanings assigned to the various byte positions within the CMOS area:

_R_e_a_l_-_t_i_m_e _c_l_o_c_k_:
     00xx0000           Seconds
     00xx0011           Alarm, seconds
     00xx0022           Minutes
     00xx0033           Alarm, minutes
     00xx0044           Hours
     00xx0055           Alarm, hours
     00xx0066           Day of the week
     00xx0077           Day of the month
     00xx0088           Month
     00xx0099           Year
     00xx00AA           Update in progress
_D_i_a_g_n_o_s_t_i_c _p_o_w_e_r _b_y_t_e_:
     00xx00EE           Bit 7 -- Chip lost power
                    Bit 6 -- Bad checksum
                    Bit 5 -- Bad configuration byte
                    Bit 4 -- Bad memory size
                    Bit 3 -- Bad hard-disk byte
                    Bit 2 -- Bad time of day
_R_e_s_t_a_r_t_-_s_t_a_t_u_s _b_y_t_e_:
     00xx00FF           Reloaded when restarting, e.g., returning from
                    protected mode
_F_l_o_p_p_y_-_d_i_s_k _d_r_i_v_e_, _d_r_i_v_e_s _A _a_n_d _B_:
     00xx1100           Bits 7-4 -- Drive A:
                           0 = no drive
                           1 = 360-kilobyte drive
                           2 = 1.2-megabyte drive
                           3 = 720-kilobyte drive
                           4 = 1.44-megabyte drive
                    Bits 3-0 -- Drive B:
                           0 = no drive
                           1 = 360-kilobyte drive
                           2 = 1.2-megabyte drive
                           3 = 720-kilobyte drive
                           4 = 1.44-megabyte drive
_F_l_o_p_p_y_-_d_i_s_k _d_r_i_v_e_, _d_r_i_v_e_s _C _a_n_d _D_:
     00xx1111           Bits 7-4 -- Drive C:
                           0 = no drive
                           1 = 360-kilobyte drive
                           2 = 1.2-megabyte drive
                           3 = 720-kilobyte drive
                           4 = 1.44-megabyte drive
                    Bits 3-0 -- Drive D:
                           0 = no drive
                           1 = 360-kilobyte drive
                           2 = 1.2-megabyte drive
                           3 = 720-kilobyte drive
                           4 = 1.44-megabyte drive
_H_a_r_d_-_d_i_s_k _d_r_i_v_e_:
     00xx1122           Bits 7-4 -- First hard-disk drive
                           0 = No drive
                           1-3 = Type 1-15
                           F = Use contents of byte 19
                    Bits 3-0 -- Second hard-disk drive
                           0 = No drive
                           1-3 = Type 1-15
                           F = Use contents of byte 1A
_C_o_n_f_i_g_u_r_a_t_i_o_n _o_f _e_q_u_i_p_m_e_n_t_:
     00xx001144          Bits 7-6 -- Floppy disks
                           00 = one floppy-disk drive
                           01 = two floppy-disk drives
                           10 = three floppy-disk drives
                           11 = four floppy-disk drives
                    Bits 5-4 -- Type of display
                           00 = EGA/VGA
                           01 = CGA 40x25
                           10 = CGA 80x25
                           11 = monochrome display
                    Bit 1 -- floating-point coprocessor installed
                    Bit 0 -- Floppy-disk drive present
_M_e_m_o_r_y_:
     00xx1155--00xx1166      Amount of memory below one megabyte
     00xx1177--00xx1188      Amount of memory above one megabyte
_T_y_p_e _o_f _h_a_r_d _d_i_s_k_:
     00xx1199           Type of first hard disk.  Read only when
                    bits 7-4 of byte 0x12 equal 0xF.
     00xx2211           Type of second hard disk.  Read only when
                    bits 3-0 of byte 0x12 equal 0xF.
_M_i_s_c_e_l_l_a_n_e_o_u_s_:
     00xx22EE--00xx22FF      Checksum for bytes 0x10 through 0x2D
     00xx3300--00xx3311      Indicate memory size above one megabyte
     00xx3322           Century byte (BCD)
     00xx3333           Flag for power-on information:
                    Bit 7 -- Top 128 kilobytes of RAM is installed
                           (shadow RAM is available)
                    Bit 6 -- First boot after running set-up routine

/dev/cmos limits access to a 256-byte data area. Any attempt to read or write beyond this limit will fail.

See Also

Notes

If you want to read or set the real time clock, then you should use /dev/clock instead of /dev/cmos.

A Vendor-specific information, e.g., your system's memory configuration, is often kept in the CMOS area at locations beyond those documented above. Therefore, writing to undocumented regions of the CMOS area is extremely unwise: your computer could subsequently refuse to boot up properly. Caveat utilitor.