Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 1997 18:16:56 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        Shimon@i-Connect.Net (Simon Shapiro)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: (mainly CMOS) - howto?
Message-ID:  <199707310846.SAA27474@genesis.atrad.adelaide.edu.au>
In-Reply-To: <XFMail.970730220235.Shimon@i-Connect.Net> from Simon Shapiro at "Jul 30, 97 10:02:35 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Simon Shapiro stands accused of saying:
> 
> I need to have the followinf struct filled up with sane information.

"sane" or "correct"?

> Other than inb and outb to the BIOS registers, how do I get this data?
> 
> typedef struct dpt_sysinfo {
>     u_int8_t      drive0CMOS;             /* CMOS Drive 0 Type */
>     u_int8_t      drive1CMOS;             /* CMOS Drive 1 Type */

Uhh, are you _NUTS_?  Or if you don't care, just set them to 1, or 47.

>     u_int8_t      numDrives;              /* 0040:0075 contents */

Uhm.  This isn't a constant.  Is '2' good enough?

>     u_int8_t      processorFamily;        /* i386 vs. Alpha, etc. */

sysctl_byname on hw.machine will tell you sys.

>     u_int8_t      processorType;          /* {3,4,5,6}86  */

There's a global cpu_class (in the kernel) which is set for this.
sysctl_byname on hw.model can be used to obtain it too.

>     u_int8_t     osMajorVersion;
>     u_int8_t     osMinorVersion;         /* The OS version */
>     u_int8_t     osRevision;
>     u_int8_t     osSubRevision;

Parse the results of sysctl_byname on kern.osrelease / kern.osrevision 
for this.

Care to explain the context?  It might make guessing the "right" answers
a little easier 8)

-- 
]] Mike Smith, Software Engineer        msmith@gsoft.com.au             [[
]] Genesis Software                     genesis@gsoft.com.au            [[
]] High-speed data acquisition and      (GSM mobile)     0411-222-496   [[
]] realtime instrument control.         (ph)          +61-8-8267-3493   [[
]] Unix hardware collector.             "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707310846.SAA27474>