c2f9d95de5
'three-stage' bootstrap. There are a number of caveats with the code in its current state: - The i386 bootstrap only supports booting from a floppy. - The kernel and kld do not yet know how to deal with the extended information and module summary passed in. - PnP-based autodetection and demand loading of modules is not implemented. - i386 ELF kernel loading is not ready yet. - The i386 bootstrap is loaded via an ugly blockmap. On the alpha, both net- and disk-booting (SRM console machines only) is supported. No blockmaps are used by this code. Obtained from: Parts from the NetBSD/i386 standalone bootstrap.
41 lines
716 B
C
41 lines
716 B
C
/*
|
|
* $Id$
|
|
* From: $NetBSD: getsecs.c,v 1.1.1.1 1997/03/14 02:40:32 perry Exp $
|
|
*/
|
|
|
|
/* extracted from netbsd:sys/arch/i386/netboot/misc.c */
|
|
|
|
#include <sys/types.h>
|
|
#include <stand.h>
|
|
|
|
#include "libi386.h"
|
|
|
|
extern int biosgetrtc __P((u_long*));
|
|
|
|
time_t
|
|
time(time_t *tloc) {
|
|
/*
|
|
* Return the current time (of day) in seconds.
|
|
* XXX should be extended to do it "more right" perhaps?
|
|
* XXX uses undocumented BCD support from libstand.
|
|
*/
|
|
|
|
u_long t;
|
|
time_t sec;
|
|
|
|
if(biosgetrtc(&t))
|
|
panic("RTC invalid");
|
|
|
|
sec = bcd2bin(t & 0xff);
|
|
sec *= 60;
|
|
t >>= 8;
|
|
sec += bcd2bin(t & 0xff);
|
|
sec *= 60;
|
|
t >>= 8;
|
|
sec += bcd2bin(t & 0xff);
|
|
|
|
if (tloc != NULL)
|
|
*tloc = sec;
|
|
return(sec);
|
|
}
|