CMOS — Änderungen 2404 → 2411

Zeile 273: Zeile 273:
 
%endmacro
 
%endmacro
 
</asm>
 
</asm>
 +
 +
<c>
 +
#define CMOS_PORT_ADDRESS 0x70
 +
#define CMOS_PORT_DATA    0x71
 +
 +
/**
 +
* Liest ein Byte aus den CMOS
 +
*  @param offset Offset im CMOS
 +
*  @return Gelesener Wert
 +
*/
 +
u8 cmos_read(u8 offset) {
 +
  outb(CMOS_PORT_ADDRESS,offset&0x7F);
 +
  return inb(CMOS_PORT_DATA);
 +
}
 +
 +
/**
 +
* Schreibt ein Byte in das CMOS
 +
*  @param offset Offset im CMOS
 +
*  @param val Zu schreibender Wert
 +
*/
 +
void cmos_write(u8 offset,u8 val) {
 +
  outb(CMOS_PORT_ADDRESS,offset&0x7F);
 +
  outb(CMOS_PORT_DATA,val);
 +
}
 +
</c>
  
 
== Weblinks ==
 
== Weblinks ==