  init_device((struct dhdr FAR *)&blk_dev, NULL);
  /* If AT clock exists, copy AT clock time to system clock */
  if (!ReadATClock(bcd_days, &bcd_hours, &bcd_minutes, &bcd_seconds))
  {
    DaysSinceEpoch = BcdToDay(bcd_days);
    /*
     * This is a rather tricky calculation. The number of timer ticks per
     * second is not exactly 18.2, but rather 0x1800b0 / 86400 = 19663 / 1080
     * (the timer interrupt updates the midnight flag when the tick count
     * reaches 0x1800b0). Fortunately, 86400 * 19663 = 1698883200 < ULONG_MAX,
     * so we can simply multiply the number of seconds by 19663 without
     * worrying about overflow. :) -- ror4
     */
    ticks = (3600ul * BcdToByte(bcd_hours) +
	       60ul * BcdToByte(bcd_minutes) +
		      BcdToByte(bcd_seconds)) * 19663ul / 1080ul;
    WritePCClock(ticks);
  }
}

INIT static COUNT BcdToByte(COUNT x)
{
  return ((((x) >> 4) & 0xf) * 10 + ((x) & 0xf));
