vgabios: Move BDA setting from driver code to common code.

Always setup the BDA on a mode switch.  Call that BDA setup code

Also, always set vbe_mode and use that for finding the current mode
and for reporting the mode to vbe callers.

Signed-off-by: Kevin O'Connor <>
diff --git a/vgasrc/bochsvga.h b/vgasrc/bochsvga.h
index 81fb8f7..1eaa91a 100644
--- a/vgasrc/bochsvga.h
+++ b/vgasrc/bochsvga.h
@@ -55,6 +55,6 @@
 int bochsvga_init(void);
 void bochsvga_list_modes(u16 seg, u16 *dest, u16 *last);
 struct vgamode_s *bochsvga_find_mode(int mode);
-int bochsvga_set_mode(int mode, int flags);
+int bochsvga_set_mode(struct vgamode_s *vmode_g, int flags);
 #endif // bochsvga.h