# options VESA SC_PIXEL_MODE



## jfasi (Aug 9, 2009)

I'm trying to compile a nice kernel to get VESA support. I'm using the usual route of compiling the kernel with: 


```
options VESA
options SC_PIXEL_MODE
```

and make buildkernel KERNCONF=MYCONF gives me a syntax error on the line containing SC_PIXEL_MODE. What gives? 

I'm using 7.2-STABLE.


----------



## jfasi (Aug 9, 2009)

Sorry, just one more note. I'm using this on VMWare on a Macbook Pro, so that might raise some issues. I've tried compiling the kernel with just options VESA, whenever I try to change to a higher resolution,  I get: 


```
vidcontrol: cannot activate raster display: Inappropriate ioctl for device.
```

I assumed that this had something to do with my inability to compile with SC_PIXEL_MODE, but could the VM have something to do with it? No actual graphics support?


----------



## vermaden (Aug 9, 2009)

If you cant use graphical modes, then try this one:
*% vidcontrol MODE_34*


----------



## jfasi (Aug 9, 2009)

While I do see MODE_34 when I run vidcontrol -i mode, when I run that I get an Invalid argument error.


----------



## fronclynne (Aug 10, 2009)

You're not perchance running amd64, are you?


----------



## jfasi (Aug 10, 2009)

Nope. At first I decided to run on AMD64, and then i discovered that VESA is not supported in the 64 bit kernel. Since making virtual machines is easy as cake, I simply switched to FreeBSD i386.


----------



## SirDice (Aug 10, 2009)

jfasi said:
			
		

> I assumed that this had something to do with my inability to compile with SC_PIXEL_MODE, but could the VM have something to do with it? No actual graphics support?



I know for a fact that SC_PIXEL_MODE works on VMWare. Have a closer look at the offending line in your config. I'm sure you just made a typo somewhere.


----------



## jfasi (Aug 10, 2009)

Here is my kernel configure file: 


```
include GENERIC
ident VESAKERN

# VESA framebuffer support
options VESA 
options SC_PIXEL_MODE
```


----------



## SirDice (Aug 10, 2009)

jfasi said:
			
		

> Here is my kernel configure file:
> 
> 
> ```
> ...


Can you post the entire error?


----------



## jfasi (Aug 10, 2009)

```
--------------------------------------------------------------
>>> Kernel build for VESAKERN started on Mon Aug 10 13:42:52 UTC 2009
--------------------------------------------------------------
===> VESAKERN
mkdir -p /usr/obj/usr/src/sys

--------------------------------------------------------------
>>> stage 1: configuring the kernel
--------------------------------------------------------------
cd /usr/src/sys/i386/conf;  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin  config  -d /usr/obj/usr/src/sys/VESAKERN  /usr/src/sys/i386/conf/VESAKERN
config: /usr/src/sys/i386/conf/VESAKERN:6: syntax error
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
```


----------



## jfasi (Aug 11, 2009)

Ok, now I know something is up because I downloaded and set up 6.0-RELEASE, and it gives me the same error even there. I had considered the possibility that the option might have been removed in recent releases, but apparently there is something deeper here. Any ideas?


----------



## SirDice (Aug 11, 2009)

Does building GENERIC work?


----------



## jfasi (Aug 11, 2009)

Yes it does. It seems to have something to do with the fact that the line for SC_PIXEL_MODE is not present in /usr/src/sys/conf/options.i386. 

So, what I've tried doing is taking the relevant SC_PIXEL_MODE line from /usr/srs/sys/conf/options and pasting it into the options.i386 file. It is recognized as an option, and the kernel is compiling as I type this. It's just a question of whether it will work or will result in some unbootable monstrosity.


----------



## SirDice (Aug 11, 2009)

jfasi said:
			
		

> It seems to have something to do with the fact that the line for SC_PIXEL_MODE is not present in /usr/src/sys/conf/options.i386.


It's not in mine either. It is however in /usr/src/sys/conf/options. My VMWARE kernel config compiles just fine with it.


----------



## jfasi (Aug 11, 2009)

Ok, so I found a solution. It seems that VMware does not have a VESA BIOS at all, so trying to make it work with VESA was a lost cause. Instead, it takes nothing more than adding allscreens_flags="MODE_<mode number>" to /etc/rc.conf to enable a high resolution console in, I suspect, VGA. Also while VMware limits the size of the screen, it's just a question of going into fullscreen mode. 

Problem averted!


----------

