File tree Expand file tree Collapse file tree 7 files changed +5
-22
lines changed Expand file tree Collapse file tree 7 files changed +5
-22
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ fn hlt() {
54
54
}
55
55
56
56
#[ panic_handler]
57
+ #[ cfg( not( test) ) ]
57
58
pub fn panic ( _info : & core:: panic:: PanicInfo ) -> ! {
58
59
fail ( b'P' ) ;
59
60
}
Original file line number Diff line number Diff line change 1
1
use super :: fail:: { fail, UnwrapOrFail } ;
2
2
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
-
17
3
pub ( crate ) fn get_partition ( partitions_raw : & [ u8 ] , index : usize ) -> PartitionTableEntry {
18
4
const PARTITIONS_AREA_SIZE : usize = 16 * 4 ;
19
5
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> {
189
189
} ,
190
190
None => {
191
191
panic ! ( "next none" ) ;
192
- return None ;
193
192
}
194
193
} ,
195
194
} ;
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ impl core::fmt::Write for Writer {
36
36
}
37
37
38
38
#[ panic_handler]
39
+ #[ cfg( not( test) ) ]
39
40
pub fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
40
41
let _ = writeln ! ( Writer , "\n PANIC: {}" , info) ;
41
42
Original file line number Diff line number Diff line change 3
3
use bootloader_x86_64_bios_common:: PixelFormat ;
4
4
5
5
use crate :: { disk:: AlignedBuffer , AlignedArrayBuffer } ;
6
- use core:: { arch:: asm, fmt :: Write as _ } ;
6
+ use core:: arch:: asm;
7
7
8
8
#[ repr( packed) ]
9
+ #[ allow( dead_code) ]
9
10
struct VbeInfoBlock {
10
11
signature : [ u8 ; 4 ] , // should be "VESA"
11
12
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) {
67
67
}
68
68
69
69
#[ panic_handler]
70
+ #[ cfg( not( test) ) ]
70
71
pub fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
71
72
let _ = writeln ! ( Writer , "PANIC: {info}" ) ;
72
73
loop { }
Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ pub fn init(info: BiosFramebufferInfo) {
25
25
26
26
/// Additional vertical space between lines
27
27
const LINE_SPACING : usize = 0 ;
28
- /// Additional vertical space between separate log messages
29
- const LOG_SPACING : usize = 2 ;
30
28
31
29
struct ScreenWriter {
32
30
framebuffer : & ' static mut [ u8 ] ,
@@ -52,10 +50,6 @@ impl ScreenWriter {
52
50
self . carriage_return ( )
53
51
}
54
52
55
- fn add_vspace ( & mut self , space : usize ) {
56
- self . y_pos += space;
57
- }
58
-
59
53
fn carriage_return ( & mut self ) {
60
54
self . x_pos = 0 ;
61
55
}
You can’t perform that action at this time.
0 commit comments