You are not logged in.
fix_video likely does nothing but delay the start, https://github.com/mmalecki/grub/blob/m … fixvideo.c
If an explicit (longer) delay doesn't yield (more) reliable behavior, the test results have been random.
I really want to know is if Linux is loaded before and during the GRUB
No.
I need to focus is only when the kernel parameters are set and when it loads the kernel image, which only occurs after the GRUB.
Yes.
I don#t think that grub allows any output selection and will just use wherever the GPU puts it.
Offline
I created a diagram to better understand the flow of booting with EFI, then GRUB, loading the Linux kernel with `linuxvmlinuz-linux` and loading the Linux kernel image with `initramfs-linux.img`.
I understand these steps are executing in this orden:
The computer is powered on.
Load EFI or the other boot.
Loads GRUB
Set up GRUB
Load the kernel `/boot/vmlinuz-linux` with the parameters that you want (root, rw, nvidia_drm, video, etc).
Load the kernel image in RAM for `/boot/initramfs-linux.img`which takes the loaded kernel before `/boot/vmlinuz-linux`.
At the end, prompted to log in.
Is this correct?
---
At this point, if all is correct, the main actor who set up the monitors during the boot is when load and execute the kernel image in RAM for `/boot/initramfs-linux.img`. Using the kernel created with the GRUB options. Is this correct?
---
Other question: when the command `linux›/boot/vmlinuz-linux root=UUID=e6f... rw nvidia_drm.modeset=1 video=DP-0:800x600@60e...` is executed.
Does this command generate binaries files based on the parameters?
Or does it generate files with these options?
Why am I asking? If it generates files, should be easier to debug. Because, I can change parameters on the fly, same as I can do in the `grub.cfg` file. If it generates binaries, should be harder to debug.
---
Diagram of the boot of Linux.
| +-----------+
| | Start the |
| | Laptop |
| +-----------+
| |
| |
| v
| +---------+
| | GRUB |
| +---------+
| |
| v
| | +--------------------------------+
| | | # 00_header |
| | | Check default font path |
| | | insmod part_gpt |
| | | insmod ext2 |
| | | set gfxmode=1920x1080x32 |
| | | load_video |
| | | insmod gfxterm |
| | | set locale_dir=$prefix/locale |
| | | set lang=en_US |
| | | insmod gettext |
| | | terminal_input gfxterm |
| | | terminal_output gfxterm |
| | | Check feature timeout style |
| | +--------------------------------+
| | |
| | |
| | v
| | +----------------------------+
| | | # 30_uefi-firmware |
| | | Check if platform is EFI |
| | | fwsetup |
| | +----------------------------+
| | |
| | |
| | v
| | +------------------------+
| | | # 41_custom |
| | | Check if custom.cfg |
| | +------------------------+
| | |
| | |
| | v
| | +----------------------------------------------------------------------------------+
| | | # 10_linux |
| | | menuentry |
| | | › load_video |
| | | › set gfxpayload=keep |
| | | › insmod gzio |
| | | › insmod part_gpt |
| | | › insmod ext2 |
| | | › search --no-floppy --fs-uuid --set=root e6fc0d0d-b8f8-446f-88b6-c68ff9228d6a |
| | | › echo› 'Loading Linux linux ...' |
| | | › linux›/boot/vmlinuz-linux root=UUID=e6fc0d0d-b8f8-446f-88b6-c68ff9228d6a |
| | | rw kvm-intel.nested=1 nvidia_drm.modeset=1 video=DP-0:800x600@60e |
| | | video=DP-1:1024x768e video=DP-2:1920x1080e video=DP-3:800x600e |
| | | video=DP-4:800x600e video=eDP-1:1920x1080e |
| | | › echo› 'Loading initial ramdisk ...' |
| | | › initrd› /boot/initramfs-linux.img |
| | +----------------------------------------------------------------------------------+
| | |
| | |
| | v
| | | +---------------------------------------------------+
| | | | # Load a Linux kernel image from file |
| | | | linux›/boot/vmlinuz-linux |
| | | | Parameters: |
| | | | - root=UUID=e6fc0d0d-b8f8-446f-88b6-c68ff9228d6a |
| | | | - rw |
| | | | - kvm-intel.nested=1 |
| | | | - nvidia_drm.modeset=1 |
| | | | - video=DP-0:800x600@60e |
| | | | - video=DP-1:1024x768e |
| | | | - video=DP-2:1920x1080e |
| | | | - video=DP-3:800x600e |
| | | | - video=DP-4:800x600e |
| | | | - video=eDP-1:1920x1080e |
| | | +---------------------------------------------------+
| | | |
| | | |
| | | v
| | | +------------------------------------------------------------------+
| | | | # Load, in order, all initial ramdisks for a Linux kernel image |
| | | | initrd› /boot/initramfs-linux.img |
| | | +------------------------------------------------------------------+
| | |Offline
Hi, again @Seth. Good news and bad news.
Good news: I understood all the problems with the external monitor, which sometimes is turned on.
Step by step of the boot:
The BIOS is booting. Recently, I DISABLED the fast boot option. This is the reason for years I did not see the external monitor turn on, only the internal one turned on. For the same reason, recently that I made the switch to disable the fast boot, I have noticed that sometimes the external monitor shows Arch Linux booting.
In this intermediate period, the physical components of the laptop are being recognized, for example the graphics card. But, the BIOS does not wait to detect all the components, instead it jumps to GRUB.
In GRUB, if I add a sleep of 60 seconds anywhere in the `/boot/grub/grub.cfg` file. It can be at the beginning, in the third line of code of the file, or after the last instruction executed `initrd› /boot/initramfs-linux.img`. Anywhere I put it, what happens is that it recognizes the monitor every time I boot Arch Linux, it never fails.
It shows the log in screen in console mode in both monitors.
I log in with my credentials.
I execute `xinit` or `systemctl start gdm.service`.
I got the graphic environment (desktop, windows manager, etc.).
Solved the mystery, I didn't test which is the best sleep in seconds to recognize the GPU device after the BIOS initialization.
---
It was a lot of lessons learned and new knowledge, but the bad news is that something still wrong. I mean, the “video” parameter should be work in “GRUB_CMDLINE_LINUX_DEFAULT”. Why? Because, at the end when I start the graphic interface with GDM or Xorg, is shows the on both monitors. Furthermore, if I close these sessions, it returns to the log in screen (initial log in screen in console mode), and it shows on both monitors. It means, Arch Linux can recognize both monitors and set up them to display the console log in screen.
Let me give a real example.
The BIOS option fast boot is ENABLED.
Execute GRUB without sleeps.
Shows the log in screen in console mode, only on the internal monitors.
I log in with my credentials.
I execute `systemctl start gdm.service`.
I got the graphic environment (desktop, windows manager, etc.). In BOTH monitors.
stop the “gdm.service”.
Come back to the console, log in screen, but it shows in both monitors. Because, the graphic interface enabled them.
That I want to show is if the fast boot is enabled, it turns on both monitors executing GDM, but not during the GRUB, “linux” or “initrd” process.
Why is not working the “video” parameter for the kernel.
What is executing in GDM but not in “linux” or “initrd” to enable both monitors and display the process.
How can I activate both monitors during the GRUB process?
At the end, “linux” or “initrd” load and execute Arch Linux in the memory RAM and the action for log in, is based on these loads or this base.
Offline
That I want to show is if the fast boot is enabled, it turns on both monitors executing GDM, but not during the GRUB, “linux” or “initrd” process.
Why is not working the “video” parameter for the kernel.
What is executing in GDM but not in “linux” or “initrd” to enable both monitors and display the process.
How can I activate both monitors during the GRUB process?
At the end, “linux” or “initrd” load and execute Arch Linux in the memory RAM and the action for log in, is based on these loads or this base.
I did some tests and research. Furthermore, I can resolve some questions in the list.
Important note:
I set up in BIOS the option “fast boot” enabled.
When I activate the nouveau, it automatically starts both monitors with the correct resolution. It works with this kernel parameter: `GRUB_CMDLINE_LINUX_DEFAULT=""`.
---
Why is not working the “video” parameter for the kernel.
It is not working because in the Kernel parameter is enabled the `nvidia_drm`. The video parameter only works with nouveau. This is reinforced by this article: “Nouveau - Setting console resolution”.
I did a test trying to disable the internal monitor, and it was success with this configuration and kernel parameter: `GRUB_CMDLINE_LINUX_DEFAULT="video=eDP-1:d"`. Furthermore, I tried to change the resolution for the external monitor, but it displays some error in `Journalctl`. I am sure I can fix them and my external monitor should be display with the resolution in the video parameter.
# Install nouveau
sudo pacman -Ss xf86-video-nouveau
# Comment this line
sudo vim /usr/lib/modprobe.d/nvidia-utils.conf
#blacklist nouveau
sudo vim /etc/mkinitcpio.conf
MODULES=(nouveau)
sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="video=eDP-1:d"
mkinitcpio -p linux
grub-mkconfig -o /boot/grub/grub.cfg---
At the end, “linux” or “initrd” load and execute Arch Linux in the memory RAM and the action for log in, is based on these loads or this base.
Yes, this logic is correct because the nouveau is doing the same. When it starts the boot after GRUB, it detects both monitors and shows the booting information on both.
---
What is executing in GDM but not in “linux” or “initrd” to enable both monitors and display the process.
How can I activate both monitors during the GRUB process?
I have some clues, and I'll test today or tomorrow. I found this article: “Kernel mode setting – Forcing modes and EDID”.
The premise is: If the “fast boot” option is enabled in BIOS, and Nouveau recognizance both monitors, then when I enable in the Kernel parameters the option nvidia_drm. It needs special set up in GRUB to detect the NVIDIA graphic and be recognized during the boot. The last research about the BIOS or Linux boot, needs time to wake up the NVIDIA GPU, should be discarded with this premise based on the Nouveau results.
Offline
I have some clues, and I'll test today or tomorrow. I found this article: “Kernel mode setting – Forcing modes and EDID”.
The premise is: If the “fast boot” option is enabled in BIOS, and Nouveau recognizance both monitors, then when I enable in the Kernel parameters the option nvidia_drm. It needs special set up in GRUB to detect the NVIDIA graphic and be recognized during the boot. The last research about the BIOS or Linux boot, needs time to wake up the NVIDIA GPU, should be discarded with this premise based on the Nouveau results.
Wooow! It was a big discover, but let me start with the EDID. Well, it didn't work, I followed the articles and nothing.
What was the great discovery?
First, I restored the basic boot, it means the Kernel parameter is only the nvidia_drm, the Mkinitcpio only loads the NVIDIA modules.
If, I turn on my laptop, then shows on my internal monitor the GRUB, the Linux kernel load by images, then the login screen.
And, I disconnect physically the cable of my external monitor which is connected to the laptop, or I disconnect the electric wire from the electric power output.
Then, I reconnect to the computer or to the power output, it blinks the internal monitor, and then it shows in both monitors.
I got the clue based on this article: Kernel mode setting – Forcing modes and EDID. “For external displays, replugging them is sufficient to see the effect”.
f you are doing early KMS, you must include the custom EDID file in the initramfs, otherwise you will run into problems.
The value of the drm.edid_firmware parameter may also be altered after boot by writing to /sys/module/drm/parameters/edid_firmware:
# echo edid/your_edid.bin > /sys/module/drm/parameters/edid_firmware
This will only take affect for newly plugged in displays, already plugged-in screens will continue to use their existing EDID settings.
*** For external displays, replugging them is sufficient to see the effect however. ***
Help!
Does someone know some instruction in GRUB or MKinitcpio to power off the monitors and power on again in the Linux booting?
Last edited by airv_zxf (2023-05-19 19:52:29)
Offline
at the end when I start the graphic interface with GDM or Xorg, is shows the on both monitors
At this point either X11 or the wayland compositor have taken control over the framebuffer.
Why is not working the “video” parameter for the kernel.
I'd say because the output isn't ready when the kernel starts.
Or because the used parameters are wrong.
They apply to kms and while nvidia has its own kms implementation, the nouveau article does not suggest that the parameters aren't handled by that.
In GRUB, if I add a sleep of 60 seconds anywhere in the `/boot/grub/grub.cfg` file. It can be at the beginning, in the third line of code of the file, or after the last instruction executed `initrd› /boot/initramfs-linux.img`. Anywhere I put it, what happens is that it recognizes the monitor every time I boot Arch Linux, it never fails.
1. Does this hold w/ fast-start enabled in the BIOS?
2. You can use this condition to make sure the video parameters are correct and used by trying to explicitly disable the output.
You're generally down to the efifb, unless maybe https://wiki.archlinux.org/title/Uvesafb or https://wiki.archlinux.org/title/KMSCON
You cannot power on/off the monitor in software, you can use vbetool to trigger the dpms, but that won't change anything about the EDID as the output will typically not re-appear this way (esp. not if you have to physically unplug it for the effect)
From all you've written so far, this mostly sounds like a race condition w/ the external output showing up (either too early or more likely) too late for the initial kms, so you'll have to sleep your way around that.
If the problem is indeed the late edid, you'll have to add that to the initramfs.
Offline
Final remark on this topic. As I mentioned, I will erase my SSD, and it happened yesterday, then I installed from scratch Arch Linux again.
Trying to set up NVIDIA, I found that the module KMS is the responsible to loading my external monitor, but the NVIDIA driver is not loaded. When, I disable the KMS, then I got the main problem, which is the external monitor not shows in the Boot or the TTY, furthermore the NVIDIA driver is loaded.
Basically, the problem for the external monitor is NVIDIA, which looks like they didn't create a good module as KMS to detect, load in the O.S. and turn on the external monitor.
---
Kernel mode setting - ArchWiki
Kernel Mode Setting (KMS) is a method for setting display resolution and depth in the kernel space rather than user space. The Linux kernel's implementation of KMS enables native resolution in the framebuffer and allows for instant console (tty) switching.
Offline