# Graphics issues while booting



## FrankR (Oct 18, 2021)

First try to install FreeBSD on a MacPro late 2008.
During the installation, in this case FreeBSD 11.4 amd-64, as soon as the first drivers are loaded, I only get stripes on the monitor. The boot process continues in the background, but unfortunately I can't make any inputs without seeing something.
I have tried different graphic cards without success. 
My question to you, which boot parameters (loader promt) can I change to get a text?
Thanks for your help!
Frank


----------



## SirDice (Oct 18, 2021)

FrankR said:


> in this case FreeBSD 11.4 amd-64


FreeBSD 11.4 is now end-of-life and not supported anymore. I would try 12.2-RELEASE or 13.0-RELEASE.









						FreeBSD Security Information
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org


----------



## FrankR (Oct 18, 2021)

Ok, I tried with the version 12.3, but same behavior as described above.


----------



## eternal_noob (Oct 18, 2021)

There is no 12.3-RELEASE. Is this a typo or did you install a development version rather than release?


----------



## FrankR (Oct 18, 2021)

sorry, type error it's the version 12.2!


----------



## grahamperrin@ (Oct 18, 2021)

During the ten-second countdown, escape to the loader prompt then: 

`gop list`



FrankR said:


> MacPro late 2008.



<https://everymac.com/systems/apple/mac_pro/index-macpro.html> which one of the four? 

With which graphics card did you begin?



FrankR said:


> different graphic cards



Can you let us know the makes and models?

Was the problem (stripes, or _tearing_) the same with all tested cards?


I'm familiar with the symptom, from hardware that I used years ago, maybe with PC-BSD. I can't recall the (then) workaround and the forum is no longer available. Sorry!


----------



## Geezer (Oct 19, 2021)

SirDice said:


> FreeBSD 11.4 is now end-of-life and not supported anymore.



Looks like the monitor is end-of-life.


----------



## bsduck (Oct 19, 2021)

I get a similarly corrupted display if I boot OpenBSD (not FreeBSD) on my HP laptop. The boot menu is fine, but everything that comes next is scrambled. The solution in my case is to change the machine's UEFI settings from "Native UEFI" to "Hybrid UEFI (with CSM)", or switch to legacy BIOS mode. Unfortunately, Macs typically don't have such settings. But given that it's a "Pro", maybe yours does?


----------



## grahamperrin@ (Oct 19, 2021)

FreeBSD bug 259258 – Outdated direction from /where/#install to a non-existent anchor in the FreeBSD Handbook



bsduck said:


> … Unfortunately, Macs typically don't have such settings. …



I shouldn't expect Apple's firmware to offer anything except UEFI.



> … from "Native UEFI" to "Hybrid UEFI (with CSM)", or switch to legacy BIOS mode. …



Nice reminder.

*UEFI*, TrueOS Desktop, *HP EliteBook 8540p*, 2016-08-04: <https://photos.app.goo.gl/Uy4gsZ5n2jMwKv7q8>. <https://github.com/trueos/trueos-core/issues/15#issue-169800408> steps (2)–(9) remind me that this type of thing occurred with the installation routine _probably_ *before and after the X session* during which the essentials of the routine _were_ visible.

<https://bsd-hardware.info/?view=computers&type=notebook&vendor=Hewlett-Packard&model=EliteBook+8540p> no match. From <https://www.levnapc.cz/ProductsFiles/hp-elitebook-8540p-8540w-manual-en.pdf> page 1 (PDF page 8): *NVIDIA N10P-NS 1GB DDR3 - NVIDIA NVS 5100*.


----------



## grahamperrin@ (Oct 19, 2021)

FrankR welcome to FreeBSD Forums.

FreeBSD

If this is your first experience with FreeBSD: apologies for technobabble.



SirDice said:


> 13.0-RELEASE.



∴ aim for FreeBSD-13.0-RELEASE-amd64-disc1.iso or FreeBSD-13.0-RELEASE-amd64-dvd1.iso from <https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.0/>. _disc1_ should be enough for test purposes.

Ignore phrases such as _disc_ and _DVD_ within filenames in these areas (the images are *not* intended to fit on normal discs).

Re: <https://docs.freebsd.org/en/books/handbook/bsdinstall/#bsdinstall-usb> the advice for an .img file can equally apply to creating a USB flash drive from an .iso file.

If the installer for 13.0-RELEASE is similarly bugged with your graphics card, then you might try FreeBSD-14.0-CURRENT-amd64-20211014-04c91ac48ad-250051-disc1.iso from <https://download.freebsd.org/ftp/snapshots/amd64/amd64/ISO-IMAGES/14.0/>, although support for -CURRENT is not provided in FreeBSD forums (and it's not release quality).

GhostBSD

<https://www.ghostbsd.org/download>

If none of the installers for FreeBSD work, you might try the installer for GhostBSD, which is based on FreeBSD 13.0-STABLE.

Loosely speaking: 

-STABLE is somewhere between release quality -RELEASE and development of -CURRENT
the GhostBSD approach to use of FreeBSD 13.0-STABLE is release quality.


----------



## FrankR (Oct 21, 2021)

The model is:
Mac Pro 2,8 Ghz Quad-Core

After i did some checks i want to share with you the output of "hw-probe" (link below) to the MacPro server.
maybe there are useful hints that can help us.

output of "hw-probe"


----------



## grahamperrin@ (Oct 21, 2021)

Thanks. From <https://bsd-hardware.info/?probe=15d56aee58#pci:1002-9588-106b-00a6>:



> > Advanced Micro Devices, Inc. [AMD/ATI] *RV630 XT [Radeon HD 2600 XT]* … vgapci



Please do try the more recent installer for 13.0-RELEASE.


----------



## FrankR (Oct 22, 2021)

I have made some progress in this matter. The live-test-installation of version 13 via the good old CD-Rom has brought enlightenment. Thanks for the hint with version 13.
Please have a look at the output of dmesg.
With the vga drivers instead of efifb it works, so no more stripes on the screen!
Unfortunately I can't manage the content of "loader.conf" so that it works with the version installed on the HD.

Here the output of dimesg on the live system via CD-Rom:
*VT(vga): resolution 640x480*
*.....*
*vgapci0: Boot video device*

Output of the installed system:
*VT(efifb): resolution 1920x1080*


----------



## SirDice (Oct 22, 2021)

FrankR said:


> Unfortunately I can't manage the content of "loader.conf" so that it works with the version installed on the HD.


What do you mean? It's just a file you can edit.


----------



## Buck (Oct 22, 2021)

I remember having a simliar problem with DragonflyBSD. We were trying to make it work, and I don't remember the techincalities unfortunately, but I had to play with stripes and framebuffer parameters to feed the correct mode to the GPU. I managed to make it look _almost_ correctly, but never quite right. It was seemingly a problem with Apple's GPU firmware from which BSD cannot extract the necessary parameters to make the graphics mode work, so it's falling back to defaults and you see garbled screen. GPUs with non-Apple firmware won't work for console text because they won't be initialized by the EFI or vt.

Is it possible maybe to avoid switching modes entirely, for example by setting _hw.vga.textmode_ to 1? As outlined in vt()?


----------



## FrankR (Oct 22, 2021)

Sorry for the confusion, I can edit the "loader.conf" file, the question was, what are the required settings to write in it?


----------



## FrankR (Oct 22, 2021)

> Is it possible maybe to avoid switching modes entirely, for example by setting _hw.vga.textmode_ to 1? As outlined in vt()?


I tried that, as described int "vt()" unfortunately no change at boot time. I guess there must be a combination of settings.


----------



## sprock (Oct 22, 2021)

Here are the loader.conf settings I use on an old iMac from around 2008 on 12.2-RELEASE.

```
hw.efifb.stride=1728
hw.efifb.address=0x80010000
```

The address parameter can vary with the amount of RAM in the machine: previously, with 1.5GB of RAM in this machine it was:
	
	



```
0x60010000
```

If you can boot your machine into OSX there is a script you can use to find the parameters for your machine:

```
CODE]# From: https://ubuntuforums.org/showthread.php?t=1557326
# See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202730

sudo ioreg -lw0 |grep manufacturer|cut -b25-80;sudo ioreg -lw0|grep "product-name"|cut -b 25-80;sudo dtrace -qn 'BEGIN{boot_args=((struct boot_args*)(`PE_state).bootArgs);printf("FrameBuff erBase: 0x%08x\nPixelsPerScanLine: %d\nHorizontalResolution: %d\nVerticalResolution: %d", boot_args->Video.v_baseAddr, boot_args->Video.v_rowBytes/4, boot_args->Video
```
[/CODE]


----------



## Buck (Oct 22, 2021)

Yeah! It was the stride (not stripe as I said), and the address! I remember tweaking them endlessly as it was impossible to live-tweak them and rebooting before getting something semi-usable. Wonder if sprock's code works.


----------



## FrankR (Oct 23, 2021)

After several changes in loader.conf, I am still no further. As the machine will not run x-server, a vga display would be fine.
Is there a way to swap the efi framebuffer driver against vt-vga?


----------



## Buck (Oct 23, 2021)

Do you see any changes when changing hw.efifb.stride and hw.efifb.address? Do large changes, not just +1 to each, reboot, observe the result. You should see the image changing.


----------



## FrankR (Oct 24, 2021)

Now I could finally get a working display 
Thanks a lot for your support!


> hw.efifb.address="0x80010000"
> hw.efifb.stride="1920"


That was working for me!
If I now want to make these settings on the loader probt when installing a new system, what is the procedure, or the sample code?
In addition, I have found little about the "stride" function on the net, where is there further info about it?


----------



## grahamperrin@ (Oct 24, 2021)

efivar(8) might be of interest. 

Also (for your Mac case) efibootmgr(8), although that's boot-specific.


----------

