l4re-base-25.08.0

This commit is contained in:
2025-09-12 15:55:45 +02:00
commit d959eaab98
37938 changed files with 9382688 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
# cyclichpet, eb_leds, eb_leds_gfx, hpet
optional: libio
# cyclichpet, hpet
optional: libirq
# cyclichpet
optional: libdrivers_hpet
# eb_leds_gfx, malloc-test
optional: libpthread
# eb_leds_gfx
optional: scout-gfx
# event_dump
requires: l4re
# fbreboot, lobacc, marvin
optional: libgfxbitmap libstdc++ libevent
# fbreboot, magbag
optional: libpng mag-gfx
# fbreboot
optional: libgfxbitmap-support libevent
# fortran-hello, fortran-omp
optional: libgfortran
# fortran-omp
optional: libgomp
# inhibitor, pwr
optional: libio-vbus
# lobacc
optional: libloba
# luash, marvin
optional: readline libc_be_fs_noop libc_support_misc
# luash
optional: lua
# magbag
optional: cxx_libc_io cxx_io
# hello-shared
requires: stdlibs-sh
# tarfs
optional: libl4revfs-fs-tarfs libmount libstdc++
# tbuf
optional: libtbuf
# uhello
requires: l4sys
Maintainer: adam@os.inf.tu-dresden.de

View File

@@ -0,0 +1,6 @@
PKGDIR = .
L4DIR ?= $(PKGDIR)/../../..
TARGET = $(wildcard [a-z]*)
include $(L4DIR)/mk/subdir.mk

View File

@@ -0,0 +1,7 @@
PKGDIR ?= ..
L4DIR ?= $(PKGDIR)/../../..
TARGET = cat
SRC_C = cat.c
include $(L4DIR)/mk/prog.mk

View File

@@ -0,0 +1,43 @@
/**
* \file
* \brief A cat.
*
* \date
* \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
*
*/
/*
* (c) 2009 Author(s)
* economic rights: Technische Universität Dresden (Germany)
*
* This file is part of TUD:OS and distributed under the terms of the
* GNU General Public License 2.
* Please see the COPYING-GPL-2 file for details.
*/
#include <stdio.h>
int main(int argc, char **argv)
{
int i;
FILE *fp;
char buf[1024];
size_t r;
for (i = 1; i < argc; ++i)
{
fp = fopen(argv[i], "r");
if (!fp)
{
perror(argv[i]);
continue;
}
while ((r = fread(buf, 1, sizeof(buf), fp)))
fwrite(buf, 1, r, stdout);
fclose(fp);
}
return 0;
}

View File

@@ -0,0 +1,9 @@
PKGDIR ?= ..
L4DIR ?= $(PKGDIR)/../../..
TARGET = ex_eb_leds
SRC_C = eb_leds.c
REQUIRES_LIBS = libio
DEPENDS_PKGS = $(REQUIRES_LIBS)
include $(L4DIR)/mk/prog.mk

View File

@@ -0,0 +1,104 @@
/* SPDX-License-Identifier: MIT */
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
*/
/*
* The ARM EB boards have 8 LEDs which we can play a bit with. This example
* shows how to get access to the I/O memory...
*/
#include <l4/io/io.h>
#include <stdio.h>
#include <time.h>
enum {
USERSW = 0x4,
LED = 0x8,
};
static l4_addr_t sys_base;
static void write_led(int val)
{
*(volatile unsigned long *)(sys_base + LED) = val & 0xff;
}
static unsigned char read_user_switch(void)
{
/* only 8 switches there, so char return is enough */
return *(volatile unsigned long *)(sys_base + USERSW);
}
static void do_fancy(char val)
{
int mode = val & 0x80;
int speed = val & 0x7f;
if (!mode)
{
static int pos, delta = 1;
write_led(1 << pos);
pos += delta;
if (pos == 7)
delta = -1;
else if (pos == 0)
delta = 1;
}
else
{
static int pos, delta = 1;
write_led((1 << pos) | (1 << (7 - pos)));
pos += delta;
if (pos == 3)
delta = -1;
else if (pos == 0)
delta = 1;
}
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = (500000 / (speed + 1)) * 1000;
nanosleep(&ts, NULL);
}
int main(void)
{
l4io_device_handle_t dh;
l4io_resource_handle_t hdl;
char prev = 0;
/* Look for system controller, the registers we want are there */
if (l4io_lookup_device("System Control", &dh, 0, &hdl))
{
printf("Could not get system controller memory region.\n");
return 1;
}
/* Now get the IO memory from it. We know that it just has one memory
* region, so we just do this one once: */
sys_base = l4io_request_resource_iomem(dh, &hdl);
if (sys_base == 0)
{
printf("Could not map system controller region.\n");
return 1;
}
printf("User Switches (toggle them now but don't forget their initial setting!):\n");
while (1)
{
int i;
char val = read_user_switch();
if (prev != val)
{
for (i = 0; i < 8; ++i)
printf("%s ", val & (1 << i) ? "ON " : "off");
printf("\n");
prev = val;
}
do_fancy(val);
}
return 0;
}

View File

@@ -0,0 +1,10 @@
PKGDIR ?= ..
L4DIR ?= $(PKGDIR)/../../..
TARGET = fortran-hello
SRC_F = main.f90
REQUIRES_LIBS = libgfortran
DEPENDS_PKGS = $(REQUIRES_LIBS)
include $(L4DIR)/mk/prog.mk

View File

@@ -0,0 +1,7 @@
! -*- Mode: F90 -*-
program hello
print *, "Hello World!"
end program hello
! EOF

View File

@@ -0,0 +1,7 @@
PKGDIR ?= ..
L4DIR ?= $(PKGDIR)/../../..
TARGET = reboot
SRC_C = main.c
include $(L4DIR)/mk/prog.mk

View File

@@ -0,0 +1,26 @@
/* SPDX-License-Identifier: MIT */
/*
* Copyright (C) 2020, 2024 Kernkonzept GmbH.
* Author(s): Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
*
*/
/*
* \brief Just reboot
* \date 2006-03
* \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
*
* (c) 2006-2009 Author(s)
*/
#include <l4/re/env.h>
#include <l4/sys/platform_control.h>
int main(void)
{
l4_cap_idx_t pfc = l4re_env_get_cap("pfc");
if (l4_is_valid_cap(pfc))
l4_platform_ctl_system_shutdown(pfc, 1);
return 0;
}

View File

@@ -0,0 +1,8 @@
PKGDIR ?= ..
L4DIR ?= $(PKGDIR)/../../..
TARGET = ex_hello_shared
MODE = shared
SRC_C = main.c
include $(L4DIR)/mk/prog.mk

View File

@@ -0,0 +1,28 @@
/*
* \brief A 'hello' program linked against shared libraries.
* \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
*
* This program is built with shared libraries.
*/
/*
* (c) 2009 Author(s)
* economic rights: Technische Universität Dresden (Germany)
*
* This file is part of TUD:OS and distributed under the terms of the
* GNU General Public License 2.
* Please see the COPYING-GPL-2 file for details.
*/
#include <stdio.h>
#include <unistd.h>
int main(void)
{
while (1)
{
puts("Hi World! (shared)");
sleep(1);
}
return 0;
}