diff --git a/Makefile.am b/Makefile.am index 5d7995a..57ecdc5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/README.md b/README.md index d1b0454..aa6d5cb 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/configure.ac b/configure.ac index 160e579..001341c 100644 --- a/configure.ac +++ b/configure.ac @@ -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])]) diff --git a/include/Makefile.am b/include/Makefile.am index 4aa31a5..18c976b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -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 \ diff --git a/include/kernaux.h b/include/kernaux.h index 2066024..86d490f 100644 --- a/include/kernaux.h +++ b/include/kernaux.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/kernaux/framebuffer.h b/include/kernaux/framebuffer.h new file mode 100644 index 0000000..7c25c62 --- /dev/null +++ b/include/kernaux/framebuffer.h @@ -0,0 +1,12 @@ +#ifndef KERNAUX_INCLUDED_FRAMEBUFFER +#define KERNAUX_INCLUDED_FRAMEBUFFER + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/framebuffer.c b/src/framebuffer.c new file mode 100644 index 0000000..7ec5b91 --- /dev/null +++ b/src/framebuffer.c @@ -0,0 +1,8 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +__attribute__((unused)) +static const int foobar = 0;