[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: booting on the serial console



Usually, in BSD, you pass -P or -h to the /boot/loader in boot.config.
But since that loader is now completely bypassed in the boot process,
that doesn't work. I haven't found in the FreeBSD documentation what
-P/-h actually *does* at the machine level, or rather if it passes
"commandline" arguments to the kernel or what not.

Basically, I need to do two things:

 1. i need to enable the serial console. this is usually done at the
 loader level, with the -h flag, or at compile time, using the 0x30 flag
 on the sio driver

In /boot/grub/grub.cfg, I use:

menuentry "FreeBSD:blockdev_fs:da0s1a" {
       insmod bsd
       echo "Loading kernel: /boot/kernel/kernel ..."
       kfreebsd /boot/kernel/kernel -D -h
       kfreebsd_loadenv /boot/device.hints
       set kFreeBSD.vfs.root.mountfrom=:/dev/da0s1a
       echo "Booting: FreeBSD:blockdev_fs:da0s1a"
}

If you go to the GRUB2 command prompt (ESC key) and type "kfreebsd --help", you'll get a listing of all supported boot options, mostly corresponding with http://www.freebsd.org/cgi/man.cgi?query=boot

 2. i need to specify the speed of the port. this is usually done in
 config options or at compile time.

I have had very little luck with this. Usually when something in the freebsd
documentations says that you can change baud rate at runtime with a flag, I find that I have to recompile the relevant code with a macro or env-variable changed.
I end up sticking with the 9600 baud default.

I tried setting hint.sio.0.flags="0x30" along with the other environment
in grub, without any luck.

Note the kfreebsd_loadenv on device.hints above, without it sio() (or uart() for FreeBSD 8)
won't start on the serial port and you won't get a console.
You can try setting your flags in there to see if you can change the baud rate.

Is there any way I can just
revert back to the regular /boot/loader quickly?

In /boot/grub/grub.cfg, I use:

menuentry "BTX client: /boot/freebsd/loader" {
       insmod bsd
       echo "Loading btx client: /boot/freebsd/loader ..."
       kfreebsd /boot/freebsd/loader -D -h
       echo "Booting: BTX client: /boot/freebsd/loader"
}

HTH
-joey


Reply to: