Add framebuffer files

This commit is contained in:
Alex Kotov 2022-01-11 13:58:47 +05:00
parent 712b3fe76b
commit 6ce8ab0e97
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
7 changed files with 45 additions and 15 deletions

View File

@ -49,6 +49,10 @@ libkernaux_a_SOURCES += src/elf.c
TESTS += tests/test_elf
endif
if WITH_FRAMEBUFFER
libkernaux_a_SOURCES += src/framebuffer.c
endif
if WITH_MULTIBOOT2
libkernaux_a_SOURCES += \
src/multiboot2/helpers.c \

View File

@ -39,7 +39,7 @@ API
* [Guards](/examples/assert_guards.c)
* Device drivers (for debugging only)
* [Serial console](/include/kernaux/console.h)
* Framebuffer *(planned)*
* [Framebuffer](/include/kernaux/framebuffer.h) *(planned)*
* Algorithms
* [Simple command line parser](/include/kernaux/cmdline.h)
* [Example](/examples/cmdline.c)
@ -94,6 +94,7 @@ are some non-default options:
* `--with[out]-cmdline`
* `--with[out]-console`
* `--with[out]-elf`
* `--with[out]-framebuffer`
* `--with[out]-multiboot2`
* `--with[out]-pfa`
* `--with[out]-units`

View File

@ -13,24 +13,25 @@ AC_CANONICAL_HOST
dnl Features (disabled by default)
AC_ARG_ENABLE([assert], AS_HELP_STRING([--enable-assert], [enable runtime assertions]))
AC_ARG_ENABLE([guard], AS_HELP_STRING([--enable-guard], [enable argument guards]))
AC_ARG_ENABLE([guard-cond], AS_HELP_STRING([--enable-guard-cond], [enable condition guard]))
AC_ARG_ENABLE([guard-null], AS_HELP_STRING([--enable-guard-null], [enable NULL-guard]))
AC_ARG_ENABLE([assert], AS_HELP_STRING([--enable-assert], [enable runtime assertions]))
AC_ARG_ENABLE([guard], AS_HELP_STRING([--enable-guard], [enable argument guards]))
AC_ARG_ENABLE([guard-cond], AS_HELP_STRING([--enable-guard-cond], [enable condition guard]))
AC_ARG_ENABLE([guard-null], AS_HELP_STRING([--enable-guard-null], [enable NULL-guard]))
dnl Packages (enabled by default)
AC_ARG_WITH( [cmdline], AS_HELP_STRING([--without-cmdline], [without command line parser]))
AC_ARG_WITH( [console], AS_HELP_STRING([--without-console], [without serial console]))
AC_ARG_WITH( [elf], AS_HELP_STRING([--without-elf], [without ELF utils]))
AC_ARG_WITH( [multiboot2], AS_HELP_STRING([--without-multiboot2], [without Multiboot 2 information parser]))
AC_ARG_WITH( [pfa], AS_HELP_STRING([--without-pfa], [without Page Frame Allocator]))
AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils]))
AC_ARG_WITH( [cmdline], AS_HELP_STRING([--without-cmdline], [without command line parser]))
AC_ARG_WITH( [console], AS_HELP_STRING([--without-console], [without serial console]))
AC_ARG_WITH( [elf], AS_HELP_STRING([--without-elf], [without ELF utils]))
AC_ARG_WITH( [framebuffer], AS_HELP_STRING([--without-framebuffer], [without framebuffer]))
AC_ARG_WITH( [multiboot2], AS_HELP_STRING([--without-multiboot2], [without Multiboot 2 information parser]))
AC_ARG_WITH( [pfa], AS_HELP_STRING([--without-pfa], [without Page Frame Allocator]))
AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils]))
dnl Packages (disabled by default)
AC_ARG_WITH( [libc], AS_HELP_STRING([--with-libc], [with libc replacement]))
AC_ARG_WITH( [libc-memset], AS_HELP_STRING([--with-libc-memset], [with memset replacement]))
AC_ARG_WITH( [libc-strcpy], AS_HELP_STRING([--with-libc-strcpy], [with strcpy replacement]))
AC_ARG_WITH( [libc-strlen], AS_HELP_STRING([--with-libc-strlen], [with strlen replacement]))
AC_ARG_WITH( [libc], AS_HELP_STRING([--with-libc], [with libc replacement]))
AC_ARG_WITH( [libc-memset], AS_HELP_STRING([--with-libc-memset], [with memset replacement]))
AC_ARG_WITH( [libc-strcpy], AS_HELP_STRING([--with-libc-strcpy], [with strcpy replacement]))
AC_ARG_WITH( [libc-strlen], AS_HELP_STRING([--with-libc-strlen], [with strlen replacement]))
@ -64,6 +65,7 @@ dnl Packages (enabled by default)
AM_CONDITIONAL([WITH_CMDLINE], [test "$with_cmdline" != no])
AM_CONDITIONAL([WITH_CONSOLE], [test "$with_console" != no])
AM_CONDITIONAL([WITH_ELF], [test "$with_elf" != no])
AM_CONDITIONAL([WITH_FRAMEBUFFER], [test "$with_framebuffer" != no])
AM_CONDITIONAL([WITH_MULTIBOOT2], [test "$with_multiboot2" != no])
AM_CONDITIONAL([WITH_PFA], [test "$with_pfa" != no])
AM_CONDITIONAL([WITH_UNITS], [test "$with_units" != no])
@ -88,6 +90,7 @@ dnl Packages (enabled by default)
AS_IF([test "$with_cmdline" != no], [AC_DEFINE([WITH_CMDLINE], [1], [with command line parser])])
AS_IF([test "$with_console" != no], [AC_DEFINE([WITH_CONSOLE], [1], [with serial console])])
AS_IF([test "$with_elf" != no], [AC_DEFINE([WITH_ELF], [1], [with ELF utils])])
AS_IF([test "$with_framebuffer" != no], [AC_DEFINE([WITH_FRAMEBUFFER], [1], [with framebuffer])])
AS_IF([test "$with_multiboot2" != no], [AC_DEFINE([WITH_MULTIBOOT2], [1], [with Multiboot 2 information parser])])
AS_IF([test "$with_pfa" != no], [AC_DEFINE([WITH_PFA], [1], [with Page Frame Allocator])])
AS_IF([test "$with_units", != no], [AC_DEFINE([WITH_UNITS], [1], [with measurement units utils])])

View File

@ -8,6 +8,7 @@ nobase_include_HEADERS = \
kernaux/cmdline.h \
kernaux/console.h \
kernaux/elf.h \
kernaux/framebuffer.h \
kernaux/itoa.h \
kernaux/libc.h \
kernaux/multiboot2.h \

View File

@ -10,6 +10,7 @@
#include <kernaux/cmdline.h>
#include <kernaux/console.h>
#include <kernaux/elf.h>
#include <kernaux/framebuffer.h>
#include <kernaux/itoa.h>
#include <kernaux/multiboot2.h>
#include <kernaux/pfa.h>

View File

@ -0,0 +1,12 @@
#ifndef KERNAUX_INCLUDED_FRAMEBUFFER
#define KERNAUX_INCLUDED_FRAMEBUFFER
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

8
src/framebuffer.c Normal file
View File

@ -0,0 +1,8 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <kernaux/framebuffer.h>
__attribute__((unused))
static const int foobar = 0;