# ClassicOS 0.0.1 grub.cfg
# Config for GNU GRand Unified Bootloader (GRUB)
# /boot/grub/grub.cfg

insmod efi_gop
insmod efi_uga
insmod all_video
insmod font
insmod png
insmod gfxterm

if loadfont ${prefix}/unicode.pf2
then
	set gfxmode=auto
	set gfxpayload=keep
	set gfxterm_font=unicode
    terminal_input console
    terminal_output console
fi

# Enable serial console
if serial --unit=0 --speed=115200; then
    terminal_input --append serial
    terminal_output --append serial
fi

function load_video {
	if [ x$feature_all_video_module = xy ]; then
		insmod all_video
	else
		insmod efi_gop
		insmod efi_uga
		insmod ieee1275_fb
		insmod vbe
		insmod vga
		insmod video_bochs
		insmod video_cirrus
	fi
}

set cfgdir="$prefix/boot/grub/"

probe -u $root --set=usbuuid
insmod search_fs_uuid
export isopart
set isopath="/iso/"

menuentry "ClassicOS" {
	# Load partition table and file system modules
    insmod part_msdos
	insmod part_gpt
	insmod gzio
	insmod fat
	insmod iso9660
	insmod ntfs
	insmod ntfscomp
	insmod exfat
    insmod ext2
    set root='(hd0,msdos1)'
	multiboot /boot/kernel.bin
    multiboot2 /boot/kernel.bin
    module2 /boot/setup1 setup1
    module2 /boot/kernel kernel
    boot
}

# Set default menu entry
set default=0
set timeout=0
set timeout_style=menu
set fallback=0
set check_signatures=enforce
export check_signatures

# Welcome Text _ Menu Entries
menuentry "Welcome to ClassicOS" {
insmod ext2
}
menuentry "----------------------------------------------------" {
insmod ext2
}

menuentry "Reboot" --unrestricted {
    reboot
}

color_normal=light-cyan/dark-gray
color_highlight=light-red/red
menu_color_normal=cyan/blue
menu_color_highlight=white/black

search --no-floppy --set=root -l 'boot'
set root=${root}

if [ "${timeout}" = 0 ]; then
    set timeout=10
fi
