One of the things that makes Xorg a necessity is all of the manual kernel command line interaction by the user that is needed to set the resolution of the frame buffer. let's see if we can automate that
AFAIK, all of the code is in arch/x86/boot/video.c
Code: Select all
void set_video(void)
{...
for (;;) {
if (mode == ASK_VGA)
mode = mode_menu();
/* TODO: if (mode == MAX_VGA) mode = mode_max(); */
if (!set_mode(mode))
break;
...}
static unsigned int mode_max(); /* based on mode_menu()*/
here is my best guess:
Code: Select all
static void modemax(void)
{
struct card_info *card;
struct mode_info *mi;
int i;
int nmodes;
int visible;
u16 mode_max;
u16 res_max = 0;
nmodes = 0;
for (card = video_cards; card < video_cards_end; card++)
nmodes += card->nmodes;
for (card = video_cards; card < video_cards_end; card++) {
mi = card->modes;
for (i = 0; i < card->nmodes; i++, mi++) {
visible = mi->x && mi->y;
if (!visible)
continue; /* Hidden mode */
if (!mi->depth)
continue; /* I _think_ we need depth */
if ((mi->x * mi->y * mi->depth) > res_max){
res_max=(mi->x * mi->y * mi->depth);
mode_max = mi->mode ? mi->mode : (mi->y << 8)+mi->x;
}
}
}
return (mode_max)
}