File tree Expand file tree Collapse file tree 7 files changed +52
-2
lines changed Expand file tree Collapse file tree 7 files changed +52
-2
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,4 @@ edition = "2024"
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
1111#![ forbid( elided_lifetimes_in_paths) ]
1212#![ forbid( unsafe_op_in_unsafe_fn) ]
1313
14+ mod x86_64;
15+
1416use arch:: Page4K ;
1517
1618/// Returns a static reference to the global zero page.
@@ -23,6 +25,7 @@ pub fn zero_page() -> &'static Page4K {
2325#[ unsafe( no_mangle) ]
2426pub extern "C" fn init ( ) {
2527 zero_page ( ) ;
28+ uart:: panic_println!( "Hello from global" ) ;
2629}
2730
2831hypatia:: 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:: naked_asm;
9+
10+ #[ unsafe( export_name = "xferv" ) ]
11+ #[ unsafe( link_section = ".xferv" ) ]
12+ #[ unsafe( naked) ]
13+ unsafe extern "C" fn xferv ( ) {
14+ naked_asm ! ( r#"
15+ .balign 8; jmp {hi};
16+ .balign 8; jmp {bye};
17+ "# ,
18+ hi = sym hi,
19+ bye = sym bye,
20+ options( att_syntax) ) ;
21+ }
22+
23+ extern "C" fn hi ( ) {
24+ uart:: panic_println!( "Hi!" ) ;
25+ }
26+
27+ extern "C" fn bye ( ) {
28+ uart:: panic_println!( "Bye!" ) ;
29+ }
You can’t perform that action at this time.
0 commit comments