tech-kern archive

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

Re: Specification of BTINFO_CONSOLE value in bootinfo.h



On Wed, 3 Jun 2015, deco33000%yandex.com@localhost wrote:

Thanks but,

lookup_bootinfo(BTINFO_CONSOLE); -> initiate the console.

It uses BTINFO_CONSOLE as a type. What creates the strings then ? In the comments, it is said it comes from the bootloader.
But I am not sure about that.
No way to find a clue.

It is _not_ using BTINFO_CONSOLE "as a type". It is passing the value BTINFO_CONSOLE (which is 6) to the lookup_bootinfo() routine as the value of a parameter whose name is "type". (As in, which type of data
does the struct btinfo_common contain...)

The routine is searching an array of "struct btinfo_common" entries to find an entry whose member named type matches the value of the routine argument named type.

The names could easily have been foo and bar.

You can see this (for x86 platforms) in file

	src/sys/arch/x86/x86/x86_machdep.c



-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index