915resolution on solaris 10
Ported the 915resolution for solaris x86!! Now I have 1280x800 resolution on solaris laptop!!.
for anyone intrested, I got the source from here: ftp://ftp.freebsd.org/pub/FreeBSD/ports/l
ocal-distfiles/ehaupt/915resolution-0.5.t
ar.gz
got a lot of pointers from here:
http://www.livejournal.com/users/ihanic/2932.htmlthe patch to be applied
(Its ugly, I have not cleaned file names from the bsd port...)
--- 915resolution-0.5/915resolution.c Sun Dec 4 03:07:03 2005
+++ ../915resolution-0.5/915resolution.c Sat Dec 24 01:37:57 2005
@@ -22,12 +22,12 @@
#include
[
Error: Irreparable invalid markup ('<string.h>') in entry. Owner must fix manually. Raw contents below.]
Ported the 915resolution for solaris x86!! Now I have 1280x800 resolution on solaris laptop!!.
for anyone intrested, I got the source from here: ftp://ftp.freebsd.org/pub/FreeBSD/ports/local-distfiles/ehaupt/915resolution-0.5.tar.gz
got a lot of pointers from here: http://www.livejournal.com/users/ihanic/2932.html
the patch to be applied
(Its ugly, I have not cleaned file names from the bsd port...)
--- 915resolution-0.5/915resolution.c Sun Dec 4 03:07:03 2005
+++ ../915resolution-0.5/915resolution.c Sat Dec 24 01:37:57 2005
@@ -22,12 +22,12 @@
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
-#include <sys/io.h>
+//#include <sys/io.h>
#include <unistd.h>
#include <assert.h>
-
-
-
+#include <sys/sysi86.h>
+#include <ia32/sys/psw.h>
+#include "bsd_io.h"
#define NEW(a) ((a *)(calloc(1, sizeof(a))))
#define FREE(a) (free(a))
@@ -34,7 +34,7 @@
#define VBIOS_START 0xc0000
#define VBIOS_SIZE 0x10000
-#define VBIOS_FILE "/dev/mem"
+#define VBIOS_FILE "/dev/xsvc"
#define FALSE 0
#define TRUE 1
@@ -156,12 +156,24 @@
boolean unlocked;
} vbios_map;
+ static void *memmem(const void *haystack, size_t haystacklen,
+ const void *needle, size_t needlelen) {
+ void *ptr = haystack;
+ while (ptr < haystack + (haystacklen - needlelen)) {
+ if (memcmp(ptr, needle, needlelen) == 0) {
+ return (void*)ptr;
+ }
+ ptr++;
+ }
+ return NULL;
+ }
void initialize_system(char * filename) {
-
+
if (!filename) {
- if (iopl(3) < 0) {
+ if( sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0){;
+ //if (iopl(3) < 0) {
perror("Unable to obtain the proper IO permissions");
exit(2);
}
@@ -169,8 +181,10 @@
}
cardinal get_chipset_id(void) {
- outl(0x80000000, 0xcf8);
- return inl(0xcfc);
+return 0x25908086;
+
+ //outl(0x80000000, 0xcf8);
+ //return inl(0xcfc);
}
chipset_type get_chipset(cardinal id) {
bsd_io.h
#include <sys/types.h>
#ifndef _BSD_IO_H_
#define _BSD_IO_H_
/* Ripped out of cpufunc.h, changed args to match Linux. */
static __inline u_int
inl(u_int port)
{
u_int data;
__asm __volatile("inl %%dx,%0" : "=a" (data) : "d" (port));
return (data);
}
static __inline void
outl(u_int data, u_int port)
{
/*
* outl() and outw() aren't used much so we haven't looked at
* possible micro-optimizations such as the unnecessary
* assignment for them.
*/
__asm __volatile("outl %0,%%dx" : : "a" (data), "d" (port));
}
static __inline void
outb(u_char data, u_int port)
{
__asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port)));
}
static __inline__ unsigned int
inb(unsigned short int port)
{
unsigned char ret;
__asm__ __volatile__("in%B0 (%1)" :
"=a" (ret) :
"d" (port));
return ret;
}
#endif