feat: ✨ Add emojis to the chainboot protocol
This commit is contained in:
parent
9dcc5b192a
commit
92feb2d982
|
@ -74,7 +74,7 @@ fn kernel_main(max_kernel_size: u64) -> ! {
|
||||||
|
|
||||||
print!("{}", LOGO);
|
print!("{}", LOGO);
|
||||||
println!("{:>51}\n", BcmHost::board_name());
|
println!("{:>51}\n", BcmHost::board_name());
|
||||||
println!("[<<] Requesting kernel image...");
|
println!("⏪ Requesting kernel image...");
|
||||||
|
|
||||||
let kernel_addr: *mut u8 = BcmHost::kernel_load_address() as *mut u8;
|
let kernel_addr: *mut u8 = BcmHost::kernel_load_address() as *mut u8;
|
||||||
|
|
||||||
|
@ -94,7 +94,10 @@ fn kernel_main(max_kernel_size: u64) -> ! {
|
||||||
|
|
||||||
// Check the size to fit RAM
|
// Check the size to fit RAM
|
||||||
if size > max_kernel_size {
|
if size > max_kernel_size {
|
||||||
println!("ERR Kernel image too big (over {} bytes)", max_kernel_size);
|
println!(
|
||||||
|
"ERR ❌ Kernel image too big (over {} bytes)",
|
||||||
|
max_kernel_size
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +121,7 @@ fn kernel_main(max_kernel_size: u64) -> ! {
|
||||||
|
|
||||||
let valid = hasher.finish() == checksum;
|
let valid = hasher.finish() == checksum;
|
||||||
if !valid {
|
if !valid {
|
||||||
println!("ERR Kernel image checksum mismatch");
|
println!("ERR ❌ Kernel image checksum mismatch");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +130,7 @@ fn kernel_main(max_kernel_size: u64) -> ! {
|
||||||
}
|
}
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"[<<] Loaded! Executing the payload now from {:p}\n",
|
"⏪ Loaded! Executing the payload now from {:p}\n",
|
||||||
kernel_addr
|
kernel_addr
|
||||||
);
|
);
|
||||||
CONSOLE.lock(|c| c.flush());
|
CONSOLE.lock(|c| c.flush());
|
||||||
|
|
|
@ -84,16 +84,14 @@ where
|
||||||
{
|
{
|
||||||
let (kernel_file, kernel_size) = load_kernel(to_console2, kernel).await?;
|
let (kernel_file, kernel_size) = load_kernel(to_console2, kernel).await?;
|
||||||
|
|
||||||
to_console2.send("[>>] Sending image size\n".into()).await?;
|
to_console2.send("⏩ Sending image size\n".into()).await?;
|
||||||
|
|
||||||
to_serial.send(kernel_size.to_le_bytes().into()).await?;
|
to_serial.send(kernel_size.to_le_bytes().into()).await?;
|
||||||
|
|
||||||
// Wait for OK response
|
// Wait for OK response
|
||||||
expect(to_console2, from_serial, "OK").await?;
|
expect(to_console2, from_serial, "OK").await?;
|
||||||
|
|
||||||
to_console2
|
to_console2.send("⏩ Sending kernel image\n".into()).await?;
|
||||||
.send("[>>] Sending kernel image\n".into())
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
let mut hasher = SeaHasher::new();
|
let mut hasher = SeaHasher::new();
|
||||||
let mut reader = BufReader::with_capacity(1, kernel_file);
|
let mut reader = BufReader::with_capacity(1, kernel_file);
|
||||||
|
@ -112,7 +110,7 @@ where
|
||||||
let hashed_value: u64 = hasher.finish();
|
let hashed_value: u64 = hasher.finish();
|
||||||
|
|
||||||
to_console2
|
to_console2
|
||||||
.send(format!("[>>] Sending image checksum {:x}\n", hashed_value).into())
|
.send(format!("⏩ Sending image checksum {:x}\n", hashed_value).into())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
to_serial.send(hashed_value.to_le_bytes().into()).await?;
|
to_serial.send(hashed_value.to_le_bytes().into()).await?;
|
||||||
|
@ -203,7 +201,7 @@ where
|
||||||
// execute!(w, cursor::MoveToNextLine(1), style::Print("[>>] Received 3 BREAKs"), cursor::MoveToNextLine(1))?;
|
// execute!(w, cursor::MoveToNextLine(1), style::Print("[>>] Received 3 BREAKs"), cursor::MoveToNextLine(1))?;
|
||||||
breaks = 0;
|
breaks = 0;
|
||||||
send_kernel(&to_console2, &to_serial, &mut from_serial, kernel.clone()).await?;
|
send_kernel(&to_console2, &to_serial, &mut from_serial, kernel.clone()).await?;
|
||||||
to_console2.send("[>>] Send successful, pass-through\n".into()).await?;
|
to_console2.send("🦀 Send successful, pass-through\n".into()).await?;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while breaks > 0 {
|
while breaks > 0 {
|
||||||
|
@ -379,7 +377,7 @@ async fn main() -> Result<()> {
|
||||||
stdout,
|
stdout,
|
||||||
cursor::RestorePosition,
|
cursor::RestorePosition,
|
||||||
style::Print(format!(
|
style::Print(format!(
|
||||||
"[>>] Waiting for serial port {}\r",
|
"⏳ Waiting for serial port {}\r",
|
||||||
if serial_toggle { "# " } else { " #" }
|
if serial_toggle { "# " } else { " #" }
|
||||||
))
|
))
|
||||||
)?;
|
)?;
|
||||||
|
@ -401,7 +399,7 @@ async fn main() -> Result<()> {
|
||||||
|
|
||||||
execute!(
|
execute!(
|
||||||
stdout,
|
stdout,
|
||||||
style::Print("\n[>>] Waiting for handshake, pass-through"),
|
style::Print("\n✅ Waiting for handshake, pass-through. 🔌 Power the target now."),
|
||||||
)?;
|
)?;
|
||||||
stdout.flush()?;
|
stdout.flush()?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue