1
0
Fork 0
forked from koniifer/ableos

Removing deprecated platforms

This commit is contained in:
Able 2021-11-18 02:11:53 -06:00
parent b6ba831ea0
commit 681dc11b1b
15 changed files with 0 additions and 242 deletions

View file

@ -1,52 +0,0 @@
// AArch32 mode
// To keep this in the first portion of the binary.
.section ".text.boot"
// Make _start global.
.globl _start
.org 0x8000
// Entry point for the kernel.
// r15 -> should begin execution at 0x8000.
// r0 -> 0x00000000
// r1 -> 0x00000C42 - machine id
// r2 -> 0x00000100 - start of ATAGS
// preserve these registers as argument for kernel_main
_start:
// Shut off extra cores
mrc p15, 0, r5, c0, c0, 5
and r5, r5, #3
cmp r5, #0
bne halt
// Setup the stack.
ldr r5, =_start
mov sp, r5
// Clear out bss.
ldr r4, =__bss_start
ldr r9, =__bss_end
mov r5, #0
mov r6, #0
mov r7, #0
mov r8, #0
b 2f
1:
// store multiple at r4.
stmia r4!, {r5-r8}
// If we are still below bss_end, loop.
2:
cmp r4, r9
blo 1b
// Call kernel_main
ldr r3, =kernel_main
blx r3
// halt
halt:
wfe
b halt

View file

@ -1,7 +0,0 @@
arm-none-eabi-gcc -mcpu=cortex-a7 -fpic -ffreestanding -c src/arch/aarch32/boot.s -o boot.o
mv src/main.rs src/main.rs.pass
cargo build --release --target json_targets/aarch32-ableos.json
arm-none-eabi-gcc -T src/arch/aarch32/linker.ld -o ableos.elf -ffreestanding -O2 -nostdlib boot.o \
target/aarch32-ableos/release/libableos.rlib
mv src/main.rs.pass src/main.rs
rm boot.o

View file

@ -1 +0,0 @@
pub mod graphics;

View file

@ -1,4 +0,0 @@
use super::write;
pub fn init() {
write("booted on arm :>\n");
}

View file

@ -1,43 +0,0 @@
ENTRY(_start)
SECTIONS
{
/* Starts at LOADER_ADDR. */
. = 0x80000;
__start = .;
__text_start = .;
.text :
{
KEEP(*(.text.boot))
*(.text)
}
. = ALIGN(4096); /* align to page size */
__text_end = .;
__rodata_start = .;
.rodata :
{
*(.rodata)
}
. = ALIGN(4096); /* align to page size */
__rodata_end = .;
__data_start = .;
.data :
{
*(.data)
}
. = ALIGN(4096); /* align to page size */
__data_end = .;
__bss_start = .;
.bss :
{
bss = .;
*(.bss)
}
. = ALIGN(4096); /* align to page size */
__bss_end = .;
__bss_size = __bss_end - __bss_start;
__end = .;
}

View file

@ -1,2 +0,0 @@
const MMIO_BASE: u32 = 0x3F00_0000;
const VIDEOCORE_MBOX: u32 = MMIO_BASE + 0xB880;

View file

@ -1,38 +0,0 @@
#![allow(warnings)]
pub const ARCH: &'static str = "aarch32";
use core::intrinsics::{volatile_load, volatile_store};
pub mod drivers;
pub mod init;
pub mod mbox;
// raspi2 and raspi3 have peripheral base address 0x3F000000,
// b ut raspi1 has peripheral base address 0x20000000. Ensure
// you are using the correct peripheral address for your
// hardware.
const UART_DR: u32 = 0x3F201000;
const UART_FR: u32 = 0x3F201018;
pub fn mmio_write(reg: u32, val: u32) {
unsafe { volatile_store(reg as *mut u32, val) }
}
pub fn mmio_read(reg: u32) -> u32 {
unsafe { volatile_load(reg as *const u32) }
}
pub fn transmit_fifo_full() -> bool {
mmio_read(UART_FR) & (1 << 5) > 0
}
pub fn receive_fifo_empty() -> bool {
mmio_read(UART_FR) & (1 << 4) > 0
}
pub fn writec(c: u8) {
while transmit_fifo_full() {}
mmio_write(UART_DR, c as u32);
}
pub fn getc() -> u8 {
while receive_fifo_empty() {}
mmio_read(UART_DR) as u8
}
pub fn write(msg: &str) {
for c in msg.chars() {
writec(c as u8)
}
}
pub fn shutdown() {}

View file

@ -1,3 +0,0 @@
sh src/arch/aarch32/build.sh && \
qemu-system-arm -M raspi2 -kernel ableos.elf --serial stdio && \
rm ableos.elf

View file

@ -1 +0,0 @@
pub mod graphics;

View file

@ -1,2 +0,0 @@
use super::*;
pub fn init() {}

View file

@ -1,47 +0,0 @@
#![no_std]
#![no_main]
pub const ARCH: &'static str = "mipsr4000";
pub mod drivers;
static mut LIST: psp::Align16<[u32; 0x40000]> = psp::Align16([0; 0x40000]);
// Create a module named "sample_module" with version 1.0
psp::module!("ableos", 1, 0);
fn psp_main() {
// println!("AbleOS booted on PSP");
// todo
// println!("{}", crate::experiments::systeminfo::format_system_info());
// gl_basic();
println!("{}", crate::time::kilotime::Kilosecond::from_sec(23944));
let mut second = timer_update().seconds;
loop {
/*
{
let time = timer_update();
// FIXME: this is a little broken
if (second) == time.seconds {
if second == 59 {
second = 0;
}
// time
print!(
"{:?}/{:?}/{:?} {:02}:{:02}:{:02} UTC\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
time.year, time.month, time.day, time.hour, time.minutes, time.seconds
);
second += 1;
}
}
*/
}
}
pub fn shutdown() {}
mod simple_graphics;
use simple_graphics::gl_basic;
mod timer;
use crate::arch::timer::timer_update;
use core::ffi::c_void;
use psp::{
sys::{self, DisplayPixelFormat, GuState, TexturePixelFormat},
vram_alloc::get_vram_allocator,
{BUF_WIDTH, SCREEN_HEIGHT, SCREEN_WIDTH},
};
pub mod init;
use crate::println;

View file

@ -1,27 +0,0 @@
use crate::arch::*;
/// used as a very basic bare minimum gl example
pub fn gl_basic() {
unsafe {
let mut allocator = get_vram_allocator().unwrap();
let fbp0 = allocator
.alloc_texture_pixels(BUF_WIDTH, SCREEN_HEIGHT, TexturePixelFormat::Psm8888)
.as_mut_ptr_from_zero();
sys::sceGuInit();
sys::sceGuStart(
sys::GuContextType::Direct,
&mut LIST as *mut _ as *mut c_void,
);
sys::sceGuDrawBuffer(DisplayPixelFormat::Psm8888, fbp0 as _, BUF_WIDTH as i32);
sys::sceGuDebugPrint(
100,
100,
0xff0000ff,
b"hi there from ableOS PSP graphics\0" as *const u8,
);
sys::sceGuDebugFlush();
sys::sceGuFinish();
sys::sceGuSync(sys::GuSyncMode::Finish, sys::GuSyncBehavior::Wait);
sys::sceDisplayWaitVblankStart();
sys::sceGuDisplay(true);
}
}

View file

@ -1,13 +0,0 @@
pub fn timer_update() -> ScePspDateTime {
unsafe {
let mut tick = 0;
psp::sys::sceRtcGetCurrentTick(&mut tick);
// Convert the tick to an instance of `ScePspDateTime`
let mut date = MaybeUninit::uninit();
psp::sys::sceRtcSetTick(date.as_mut_ptr(), &tick);
let date = date.assume_init();
return date;
}
}
use core::mem::MaybeUninit;
use psp::sys::ScePspDateTime;