.TH cmos "" "" "Device Driver"
.PC "Device for reading CMOS"
.PP
.II CMOS
.II /dev/cmos
.II "kernel^CMOS"
.II "driver^CMOS"
.II "device driver^CMOS"
The file
.B /dev/cmos
the entry via which you can read your system's CMOS.
It is a part of the driver
.BR mem ,
which manages memory; thus,
it has major number 0 and minor number 3.
.PP
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:
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIReal-time clock:\fR
	\fB0x00\fR	Seconds
	\fB0x01\fR	Alarm, seconds
	\fB0x02\fR	Minutes
	\fB0x03\fR	Alarm, minutes
	\fB0x04\fR	Hours
	\fB0x05\fR	Alarm, hours
	\fB0x06\fR	Day of the week
	\fB0x07\fR	Day of the month
	\fB0x08\fR	Month
	\fB0x09\fR	Year
	\fB0x0A\fR	Update in progress
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIDiagnostic power byte:\fR
	\fB0x0E\fR	Bit 7 \(em Chip lost power
		Bit 6 \(em Bad checksum
		Bit 5 \(em Bad configuration byte
		Bit 4 \(em Bad memory size
		Bit 3 \(em Bad hard-disk byte
		Bit 2 \(em Bad time of day
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIRestart-status byte:\fR
	\fB0x0F\fR	Reloaded when restarting, e.g., returning from
		protected mode
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIFloppy-disk drive, drives A and B:\fR
	\fB0x10\fR	Bits 7-4 \(em 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 \(em Drive B:
			0 = no drive
			1 = 360-kilobyte drive
			2 = 1.2-megabyte drive
			3 = 720-kilobyte drive
			4 = 1.44-megabyte drive
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIFloppy-disk drive, drives C and D:\fR
	\fB0x11\fR	Bits 7-4 \(em 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 \(em Drive D:
			0 = no drive
			1 = 360-kilobyte drive
			2 = 1.2-megabyte drive
			3 = 720-kilobyte drive
			4 = 1.44-megabyte drive
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIHard-disk drive:\fR
	\fB0x12\fR	Bits 7-4 \(em First hard-disk drive
			0 = No drive
			1-3 = Type 1-15
			F = Use contents of byte 19
		Bits 3-0 \(em Second hard-disk drive
			0 = No drive
			1-3 = Type 1-15
			F = Use contents of byte 1A
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIConfiguration of equipment:\fR
	\fB0x014\fR	Bits 7-6 \(em 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 \(em Type of display
			00 = EGA/VGA
			01 = CGA 40\(mu25
			10 = CGA 80\(mu25
			11 = monochrome display
		Bit 1 \(em floating-point coprocessor installed
		Bit 0 \(em Floppy-disk drive present
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIMemory:\fR
	\fB0x15-0x16\fR	Amount of memory below one megabyte
	\fB0x17-0x18\fR	Amount of memory above one megabyte
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIType of hard disk:\fR
	\fB0x19\fR	Type of first hard disk.  Read only when 
		bits 7-4 of byte 0x12 equal 0xF.
	\fB0x21\fR	Type of second hard disk.  Read only when 
		bits 3-0 of byte 0x12 equal 0xF.
.DE
.DS
.ie p .ta 0.5i 1.25i 2.0i 2.75i
.el   .ta 0.5i 2.0i 2.75i 3.5i
\fIMiscellaneous:\fR
	\fB0x2E-0x2F\fR	Checksum for bytes 0x10 through 0x2D
	\fB0x30-0x31\fR	Indicate memory size above one megabyte
	\fB0x32\fR	Century byte (BCD)
	\fB0x33\fR	Flag for power-on information:
		Bit 7 \(em Top 128 kilobytes of RAM is installed
			(shadow RAM is available)
		Bit 6 \(em First boot after running set-up routine
.DE
.PP	
.B /dev/cmos
limits access to a 256-byte data area.
Any attempt to read or write beyond this limit will fail.
.SH "See Also"
.Xr "ATclock," atclock
.Xr "clock," clock
.Xr "device drivers," device_dr
.Xr "RAM" ram
.SH Notes
If you want to read or set the real time clock, then you should use
.B /dev/clock
instead of
.BR /dev/cmos .
.PP
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.
.IR "Caveat utilitor" .
