VT(vga): resolution 640x480 change at early boot stage possible?

Have question for FreeBSD graphics geek. ;-)

I'd like to change default VT(vga): resolution 640x480 (to be able to utilize full screen for system console from the very beginning of the boot-up sequence, if it is possible???)

My laptop is an old Toshiba Satellite from 2007, but I know it' native display resolution is 1280x800 with corresponding stty size of 160x50.

This is actually what I get later when /etc/rc.conf is processed and i915kms.ko is loaded. Then VT replaces "vga" driver with "fb" and laptop now utilizes its full display size.

But the question is if it's possible to switch VT(vga) driver to full native screen resolution. (I mean really VT driver, I'm not interested in switching to an old "sc" mode.) Putting i915kms_load="YES" in /boot/loader.conf doesn't make any change. That might be needed, but I don't know how to make this module load at early stage of boot-up sequence.

My vga is Intel Mobile 945GM, it is running on Intel Core Duo 32-Bit and I have installed FreeBSD 12.1-RELEASE i386. Of course it's non-UEFI installation but on GPT formated disk.

Thank you guys very much for any advice or suggestion.
 
I'd like to change default VT(vga): resolution 640x480 (to be able to utilize full screen for system console from the very beginning of the boot-up sequence, if it is possible???)
Have a look in the man pages, it's explained there: vt(4).
 
Have a look in the man pages, it's explained there: vt(4).
Thanks for info, I have read that already, but seems like kern.vt.fb.default_mode requires KMS driver to be loaded. But I'm only able to load it from /etc/rc.conf

Loading i915kms at early stage from /boot/loader.conf doesn't work but have no idea why?
 
I've seen that in my Thinkpad T430 as well (don't own it now, so cannot check).
Also, I reported a similar issue and a work-around here, so you may try this:
Code:
i915kms_load="YES"
i915kms_name="/boot/kernel/i915kms.ko"
I'm not sure what's causing that, but in my case the issue disappears when I remove nvidia* modules loading from /boot/loader.conf.
 
I have an intel video card. This worked for me:


To change the text resolution in FreeBSD 12.1
From 640x480 to 1024x768:

Add this to /boot/loader.conf:

Code:
hw.vga.textmode=1
kern.vty=vt
kern.vt.fb.default_mode="1024x768"     #For all devices
#kern.vt.fb.modes.VGA-1="1024x768"     #For a specific device
i915kms_load="YES"                #Load the kms module
i915kms_name="/boot/kernel/i915kms.ko"     #Define the module name


*******************************************
[The X windows system did not render properly after the alteration, with the VESA driver, so I did this and it used a driver called "modesetting" which appears to work.]

Reconfigure xorg under the new module and modesetting

Code:
# Xorg -configure

Test the new configuration with a visual background

Code:
# Xorg -retro -config /root/xorg.conf.new

After the new configuration has been adjusted and tested,
it can be split into smaller files in the normal location

[the filenames do not appear to matter, it looks like xorg reads each file and searches for the appropriate section name]:


/usr/local/etc/X11/xorg.conf.d/


You could also place the conf file in the legacy folder as:


/etc/X11/xorg.conf


or


/usr/local/etc/X11/xorg.conf


====================

This is an xorg.conf.d file that shuts off X windows with [alt] [ctrl] [bksp]. I gave it an arbitrary name keyboard-shutoff.conf.

Code:
Section    "InputClass"
    Identifier    "KeyboardDefaults"
    MatchIsKeyboard    "on"
    Option        "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
 
Last edited:
Manoli take snapshots before you do anything.
Because trying to up my console resolution once forced me to get comfortable with the boot loader console 🙄
 
forced me to get comfortable with the boot loader console
It's a good idea to get comfortable with it in any case. You will inevitably need it, some day. Things can always break, for whatever reason, and it's good form to know in advance what to do. How to work with loader(8), how to fix things in single user mode, etc. All things you hope never to use but will have a need for at some point in time.
 
  • Thanks
Reactions: a6h
I found out that single user mode is read only w/o mounting the filesystem.
Knowing these commands would be extremely useful for writing in single user mode
[the OS should just tell the user this when they start single user mode]:

For ZFS:
Code:
mount -u /
zfs mount -a

For UFS:

Code:
mount -u /
mount -a -t ufs
 
Thanks for info, I have read that already, but seems like kern.vt.fb.default_mode requires KMS driver to be loaded. But I'm only able to load it from /etc/rc.conf. Loading i915kms at early stage from /boot/loader.conf doesn't work but have no idea why?
i915kms is blacklisted from beeing loaded in loader.conf(5): grep module_blacklist /boot/defaults/loader.conf
module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist

It is advised to load the GPU modules from ports (in /boot/modules), the GPU modules shipped with the kernel are deprecated: pkg install drm-kmod (on 12.2 build from ports). You can try to set i915kms_name="/boot/modules/i915kms.ko" in loader.conf(5), but I did not try that. For me sysrc kld_list+=" /boot/modules/i915kms.ko" works fine, because on a UEFI system I set the initial resolution via efi_max_resolution="720p".
Tweaks for drm-kmod in /boot/loader.conf:
Code:
compat.linuxkpi.i915_fastboot="1" # SKIP UNNECESSARY MODE SETS AT BOOT TIME
compat.linuxkpi.enable_rc6="7"  # ENABLE POWER SAVING RENDER C-STATE 6
compat.linuxkpi.enable_dc="2" # ENABLE POWER SAVING DISPLAY C-STATES
compat.linuxkpi.enable_fbc="1" # ENABLE FRAME BUFFER COMPRESSION FOR POWER SAVINGS
compat.linuxkpi.semaphores="1" # USE SEMAPHORES FOR INTER RING SYNC
EDIT Clarification: I do not recommend, but you can - at your own risk - overwrite
module_blacklist="radeonkms amdgpu" in /boot/loader.conf. Just don't touch any file in /*/defaults/.
 
I didn't know that the GPU modules shipped with the kernel were depreciated nor that they blacklisted GPU modules from being loaded in /boot/loader.conf.

So I installed the latest modules from ports and this is what I found out.

Code:
i915kms_name="/boot/kernel/i915kms.ko"

Does work in /boot/loader.conf although that module is depreciated.

Code:
i915kms_name="/boot/modules/i915kms.ko"

Does not work in /boot/loader.conf, that module is not depreciated however it is blacklisted from being loaded in loader.conf.

Code:
sysrc kld_list+=" /boot/modules/i915kms.ko"

adds /boot/modules/i915kms.ko to rc.conf's kld_list.

Upon a reboot following this newer method, everything works the same however i915kms.ko appears to be loaded in rc.conf rather than loader.conf [slightly later during the boot process].

I still have:

Code:
hw.vga.textmode=1
kern.vty=vt
kern.vt.fb.default_mode="1024x768"
kern.vt.fb.modes.VGA-1="1024x768"
i915kms_load="YES"

In loader.conf.

=========
As a side note; I think if the resolution were changed too early in the boot process it would mess up how the FreeBSD menu appears.

The FreeBSD menu, I think, was designed for 640x480 resolution.
 
Last edited by a moderator:
Back
Top