Root/
Source at commit 2248 created 11 years 26 days ago. By ifabio, - Fix issue 342 booting x86 after rev.2175 (Credits to Mario, Alex and Leon). - Add new CPU Model IDs. - General code cleanup. | |
---|---|
1 | #include "libsaio.h"␊ |
2 | #include "sl.h"␊ |
3 | #include "openbsd.h"␊ |
4 | ␊ |
5 | #define OpenBSDProbeSize␉2048␊ |
6 | ␊ |
7 | bool OpenBSDProbe (const void *buf)␊ |
8 | {␊ |
9 | ␉return (OSReadLittleInt32(buf+0x200,0)==0x82564557);␊ |
10 | }␊ |
11 | void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen)␊ |
12 | {␊ |
13 | ␉char * buf=malloc(OpenBSDProbeSize);␊ |
14 | ␉str[0]=0;␊ |
15 | ␉if (!buf)␊ |
16 | ␉␉return;␊ |
17 | ␉Seek(ih, 0);␊ |
18 | ␉Read(ih, (long)buf, OpenBSDProbeSize);␊ |
19 | ␉if (!OpenBSDProbe (buf))␊ |
20 | ␉{␊ |
21 | ␉␉free (buf);␊ |
22 | ␉␉return;␊ |
23 | ␉}␊ |
24 | ␉if (OSReadLittleInt32 (buf+0x44c,0)<1)␊ |
25 | ␉{␊ |
26 | ␉␉free (buf);␊ |
27 | ␉␉return;␊ |
28 | ␉}␊ |
29 | ␉str[strMaxLen]=0;␊ |
30 | ␉strncpy (str, buf+0x478, MIN (strMaxLen, 32));␊ |
31 | ␉free (buf);␊ |
32 | }␊ |
33 |