mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Display the best-fit logo on logo-capable console devices
Logos can be disabled by passing the "consoleLogo=off" boot command line parameter.
This commit is contained in:
parent
cb7ae66556
commit
4af2ed62a0
@ -6,6 +6,7 @@ import (
|
|||||||
"gopheros/device/tty"
|
"gopheros/device/tty"
|
||||||
"gopheros/device/video/console"
|
"gopheros/device/video/console"
|
||||||
"gopheros/device/video/console/font"
|
"gopheros/device/video/console/font"
|
||||||
|
"gopheros/device/video/console/logo"
|
||||||
"gopheros/kernel/hal/multiboot"
|
"gopheros/kernel/hal/multiboot"
|
||||||
"gopheros/kernel/kfmt"
|
"gopheros/kernel/kfmt"
|
||||||
)
|
)
|
||||||
@ -33,6 +34,21 @@ func DetectHardware() {
|
|||||||
if len(consoles) != 0 {
|
if len(consoles) != 0 {
|
||||||
devices.activeConsole = consoles[0].(console.Device)
|
devices.activeConsole = consoles[0].(console.Device)
|
||||||
|
|
||||||
|
if logoSetter, ok := (devices.activeConsole).(console.LogoSetter); ok {
|
||||||
|
disableLogo := false
|
||||||
|
for k, v := range multiboot.GetBootCmdLine() {
|
||||||
|
if k == "consoleLogo" && v == "off" {
|
||||||
|
disableLogo = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !disableLogo {
|
||||||
|
consW, consH := devices.activeConsole.Dimensions(console.Pixels)
|
||||||
|
logoSetter.SetLogo(logo.BestFit(consW, consH))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if fontSetter, ok := (devices.activeConsole).(console.FontSetter); ok {
|
if fontSetter, ok := (devices.activeConsole).(console.FontSetter); ok {
|
||||||
consW, consH := devices.activeConsole.Dimensions(console.Pixels)
|
consW, consH := devices.activeConsole.Dimensions(console.Pixels)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user