File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ fn hlt() {
5454}
5555
5656#[ panic_handler]
57+ #[ cfg( not( test) ) ]
5758pub fn panic ( _info : & core:: panic:: PanicInfo ) -> ! {
5859 fail ( b'P' ) ;
5960}
Original file line number Diff line number Diff line change 11use super :: fail:: { fail, UnwrapOrFail } ;
22
3- /// We use this partition type to store the second bootloader stage;
4- const BOOTLOADER_SECOND_STAGE_PARTITION_TYPE : u8 = 0x20 ;
5-
6- /// Returns the first bootable partition in the partition table.
7- pub ( crate ) fn boot_partition ( partitions_raw : & [ u8 ] ) -> Option < PartitionTableEntry > {
8- for index in 0 ..4 {
9- let entry = get_partition ( partitions_raw, index) ;
10- if entry. partition_type == BOOTLOADER_SECOND_STAGE_PARTITION_TYPE {
11- return Some ( entry) ;
12- }
13- }
14- None
15- }
16-
173pub ( crate ) fn get_partition ( partitions_raw : & [ u8 ] , index : usize ) -> PartitionTableEntry {
184 const PARTITIONS_AREA_SIZE : usize = 16 * 4 ;
195 const ENTRY_SIZE : usize = 16 ;
Original file line number Diff line number Diff line change @@ -189,7 +189,6 @@ impl<D: Read + Seek> FileSystem<D> {
189189 } ,
190190 None => {
191191 panic ! ( "next none" ) ;
192- return None ;
193192 }
194193 } ,
195194 } ;
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ impl core::fmt::Write for Writer {
3636}
3737
3838#[ panic_handler]
39+ #[ cfg( not( test) ) ]
3940pub fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
4041 let _ = writeln ! ( Writer , "\n PANIC: {}" , info) ;
4142
Original file line number Diff line number Diff line change 33use bootloader_x86_64_bios_common:: PixelFormat ;
44
55use crate :: { disk:: AlignedBuffer , AlignedArrayBuffer } ;
6- use core:: { arch:: asm, fmt :: Write as _ } ;
6+ use core:: arch:: asm;
77
88#[ repr( packed) ]
9+ #[ allow( dead_code) ]
910struct VbeInfoBlock {
1011 signature : [ u8 ; 4 ] , // should be "VESA"
1112 version : u16 , // should be 0x0300 for VBE 3.0
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ pub fn enter_long_mode_and_jump_to_stage_4(info: &mut BiosInfo) {
6767}
6868
6969#[ panic_handler]
70+ #[ cfg( not( test) ) ]
7071pub fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
7172 let _ = writeln ! ( Writer , "PANIC: {info}" ) ;
7273 loop { }
Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ pub fn init(info: BiosFramebufferInfo) {
2525
2626/// Additional vertical space between lines
2727const LINE_SPACING : usize = 0 ;
28- /// Additional vertical space between separate log messages
29- const LOG_SPACING : usize = 2 ;
3028
3129struct ScreenWriter {
3230 framebuffer : & ' static mut [ u8 ] ,
@@ -52,10 +50,6 @@ impl ScreenWriter {
5250 self . carriage_return ( )
5351 }
5452
55- fn add_vspace ( & mut self , space : usize ) {
56- self . y_pos += space;
57- }
58-
5953 fn carriage_return ( & mut self ) {
6054 self . x_pos = 0 ;
6155 }
You can’t perform that action at this time.
0 commit comments