@@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize};
1818// ===========================================================================
1919
2020/// The OS version string
21- const OS_VERSION : & str = concat ! ( "Neotron OS, version " , env!( "CARGO_PKG_VERSION" ) , "-2" ) ;
21+ const OS_VERSION : & str = concat ! ( "Neotron OS, version " , env!( "OS_VERSION" ) ) ;
2222
2323/// We store the API object supplied by the BIOS here
2424static mut API : Option < & ' static bios:: Api > = None ;
@@ -275,6 +275,7 @@ unsafe fn start_up_init() {
275275
276276/// This is the function the BIOS calls. This is because we store the address
277277/// of this function in the ENTRY_POINT_ADDR variable.
278+ #[ no_mangle]
278279pub extern "C" fn main ( api : & ' static bios:: Api ) -> ! {
279280 unsafe {
280281 start_up_init ( ) ;
@@ -284,15 +285,14 @@ pub extern "C" fn main(api: &'static bios::Api) -> ! {
284285 let config = Config :: load ( ) . unwrap_or_else ( |_| Config :: default ( ) ) ;
285286
286287 if config. has_vga_console ( ) {
287- let mut addr: * mut u8 = core:: ptr:: null_mut ( ) ;
288- let mut width = 0 ;
289- let mut height = 0 ;
290- ( api. video_memory_info_get ) ( & mut addr, & mut width, & mut height) ;
291- if !addr. is_null ( ) {
288+ let mode = ( api. video_get_mode ) ( ) ;
289+ let ( width, height) = ( mode. text_width ( ) , mode. text_height ( ) ) ;
290+
291+ if let ( Some ( width) , Some ( height) ) = ( width, height) {
292292 let mut vga = VgaConsole {
293- addr,
294- width,
295- height,
293+ addr : ( api . video_get_framebuffer ) ( ) ,
294+ width : width as u8 ,
295+ height : height as u8 ,
296296 row : 0 ,
297297 col : 0 ,
298298 } ;
0 commit comments