File tree Expand file tree Collapse file tree 7 files changed +54
-10
lines changed Expand file tree Collapse file tree 7 files changed +54
-10
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,4 @@ edition = "2021"
1515[dependencies ]
1616arch = { package = " x86_64" , path = " ../x86_64" }
1717hypatia = { path = " ../hypatia" }
18+ uart = { path = " ../uart" }
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2021 The Hypatia Authors
2+ * Copyright 2023 The Hypatia Authors
33 * All rights reserved
44 *
55 * Use of this source code is governed by an MIT-style
99
1010ENTRY (init)
1111
12+ EXTERN(xferv);
13+
1214SECTIONS {
1315 . = 0xFFFFFC0000000000 ;
1416
17+ .xferv . :
18+ {
19+ KEEP (*(.xferv *))
20+ }
21+ . = ALIGN (4096 );
22+
1523 .text . :
1624 {
1725 *(.text *)
Original file line number Diff line number Diff line change 1- // Copyright 2021 The Hypatia Authors
1+ // Copyright 2023 The Hypatia Authors
22// All rights reserved
33//
44// Use of this source code is governed by an MIT-style
55// license that can be found in the LICENSE file or at
66// https://opensource.org/licenses/MIT.
77
8+ #![ feature( naked_functions) ]
89#![ feature( strict_provenance) ]
910#![ cfg_attr( not( test) , no_main) ]
1011#![ cfg_attr( not( test) , no_std) ]
1112#![ forbid( absolute_paths_not_starting_with_crate) ]
1213#![ forbid( elided_lifetimes_in_paths) ]
1314#![ forbid( unsafe_op_in_unsafe_fn) ]
1415
15- use arch:: Page4K ;
16-
17- /// Returns a static reference to the global zero page.
18- pub fn zero_page ( ) -> & ' static Page4K {
19- const ZERO_PAGE : Page4K = Page4K :: new ( ) ;
20- & ZERO_PAGE
21- }
16+ mod x86_64;
2217
2318/// Initialize the system.
2419#[ no_mangle]
2520pub extern "C" fn init ( ) {
26- zero_page ( ) ;
21+ uart :: panic_println! ( "Hello from global" ) ;
2722}
2823
2924hypatia:: runtime!( ) ;
Original file line number Diff line number Diff line change 1+ // Copyright 2023 The Hypatia Authors
2+ // All rights reserved
3+ //
4+ // Use of this source code is governed by an MIT-style
5+ // license that can be found in the LICENSE file or at
6+ // https://opensource.org/licenses/MIT.
7+
8+ mod xferv;
Original file line number Diff line number Diff line change 1+ // Copyright 2023 The Hypatia Authors
2+ // All rights reserved
3+ //
4+ // Use of this source code is governed by an MIT-style
5+ // license that can be found in the LICENSE file or at
6+ // https://opensource.org/licenses/MIT.
7+
8+ use core:: arch:: asm;
9+
10+ #[ export_name = "xferv" ]
11+ #[ link_section = ".xferv" ]
12+ #[ naked]
13+ unsafe extern "C" fn xferv ( ) {
14+ unsafe {
15+ asm ! ( r#"
16+ .balign 8; jmp {hi};
17+ .balign 8; jmp {bye};
18+ "# ,
19+ hi = sym hi,
20+ bye = sym bye,
21+ options( att_syntax, noreturn) ) ;
22+ }
23+ }
24+
25+ extern "C" fn hi ( ) {
26+ uart:: panic_println!( "Hi!" ) ;
27+ }
28+
29+ extern "C" fn bye ( ) {
30+ uart:: panic_println!( "Bye!" ) ;
31+ }
You can’t perform that action at this time.
0 commit comments