diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c25d23b..e2a5564 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure --with-arch ${{matrix.assert}} ${{matrix.null_guard}} ${{matrix.werror.mb2}} CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}} ${{matrix.werror.cflag}}' + run: ./configure ${{matrix.assert}} ${{matrix.null_guard}} ${{matrix.werror.mb2}} CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}} ${{matrix.werror.cflag}}' - name: make run: make - name: check diff --git a/.gitignore b/.gitignore index 3cd28c5..02515a1 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,6 @@ /tests/multiboot2_print1 /tests/multiboot2_print2 -/tests/test_arch_i386_paging /tests/test_cmdline /tests/test_elf /tests/test_itoa diff --git a/Makefile.am b/Makefile.am index 0c66f6d..1ad3f70 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,19 +25,13 @@ libkernaux_a_SOURCES = \ src/libc.c \ src/printf.c -if WITH_ARCH_I386 if ARCH_I386 libkernaux_a_SOURCES += src/arch/i386/asm.S endif -libkernaux_a_SOURCES += src/arch/i386/paging.c -TESTS += tests/test_arch_i386_paging -endif -if WITH_ARCH_X86_64 if ARCH_X86_64 libkernaux_a_SOURCES += src/arch/x86_64/asm.S endif -endif if WITH_CMDLINE libkernaux_a_SOURCES += src/cmdline.c @@ -112,10 +106,6 @@ examples_units_human_SOURCES = \ $(libkernaux_a_SOURCES) \ examples/units_human.c -tests_test_arch_i386_paging_SOURCES = \ - $(libkernaux_a_SOURCES) \ - tests/test_arch_i386_paging.c - tests_multiboot2_print1_SOURCES = \ $(libkernaux_a_SOURCES) \ tests/multiboot2_print1.c diff --git a/README.md b/README.md index 06629b4..1c645b9 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,6 @@ are some non-default options: doesn't have effect if your assetion function was set and ends execution of application (kernel). However it prevents crashes because of NULL pointer dereference in other cases. -* `--with-arch` - includes architecture-specific code (except assembly). May be - useful for testing. You can also separately enable or disable components: - * `--with[out]-arch-i386` - * `--with[out]-arch-x86-64` * `--with-libc` - provides the replacement for some standard C functions. Useful in freestanding environment, where no libc is present. You can also separately enable or disable components: @@ -104,7 +100,7 @@ environment. ``` ./autogen.sh -./configure --enable-assert --enable-null-guard --with-arch +./configure --enable-assert --enable-null-guard make ``` diff --git a/configure.ac b/configure.ac index e37f337..3240843 100644 --- a/configure.ac +++ b/configure.ac @@ -25,9 +25,6 @@ AC_ARG_WITH( [pfa], AS_HELP_STRING([--without-pfa], [without Pag AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils])) dnl Packages (disabled by default) -AC_ARG_WITH( [arch], AS_HELP_STRING([--with-arch], [with architecture-specific code])) -AC_ARG_WITH( [arch-i386], AS_HELP_STRING([--with-arch-i386], [with i386-specific code])) -AC_ARG_WITH( [arch-x86-64], AS_HELP_STRING([--with_arch-x86-64], [with x86_64-specific code])) 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])) @@ -35,20 +32,6 @@ AC_ARG_WITH( [libc-strlen], AS_HELP_STRING([--with-libc-strlen], [with strlen -AC_DEFUN([do_arch], -[ -if test -z "$with_arch_i386" -a "$host_cpu" = i386; then with_arch_i386=yes; fi -if test -z "$with_arch_x86_64" -a "$host_cpu" = x86_64; then with_arch_x86_64=yes; fi -]) -AS_IF([true], do_arch) - -AC_DEFUN([do_with_arch], -[ -if test -z "$with_arch_i386"; then with_arch_i386=yes; fi -if test -z "$with_arch_x86_64"; then with_arch_x86_64=yes; fi -]) -AS_IF([test "$with_arch" = yes], do_with_arch) - AC_DEFUN([do_with_libc], [ if test -z "$with_libc_memset"; then with_libc_memset=yes; fi @@ -76,9 +59,6 @@ AM_CONDITIONAL([WITH_PFA], [test "$with_pfa" != no]) AM_CONDITIONAL([WITH_UNITS], [test "$with_units" != no]) dnl Packages (disabled by default) -AM_CONDITIONAL([WITH_ARCH], [test "$with_arch" = yes]) -AM_CONDITIONAL([WITH_ARCH_I386], [test "$with_arch_i386" = yes]) -AM_CONDITIONAL([WITH_ARCH_X86_64], [test "$with_arch_x86_64" = yes]) AM_CONDITIONAL([WITH_LIBC], [test "$with_libc" = yes]) AM_CONDITIONAL([WITH_LIBC_MEMSET], [test "$with_libc_memset" = yes]) AM_CONDITIONAL([WITH_LIBC_STRCPY], [test "$with_libc_strcpy" = yes]) @@ -103,9 +83,6 @@ AS_IF([test "$with_pfa" != no], [AC_DEFINE([WITH_PFA], AS_IF([test "$with_units", != no], [AC_DEFINE([WITH_UNITS], [1], [with measurement units utils])]) dnl Packages (disabled by default) -AS_IF([test "$with_arch" = yes], [AC_DEFINE([WITH_ARCH], [1], [with architecture-specific code])]) -AS_IF([test "$with_arch_i386" = yes], [AC_DEFINE([WITH_ARCH_I386], [1], [with i386-specific code])]) -AS_IF([test "$with_arch_x86_64" = yes], [AC_DEFINE([WITH_ARCH_X86_64], [1], [with x86_64-specific code])]) AS_IF([test "$with_libc" = yes], [AC_DEFINE([WITH_LIBC], [1], [with libc replacement])]) AS_IF([test "$with_libc_memset" = yes], [AC_DEFINE([WITH_LIBC_MEMSET], [1], [with memset replacement])]) AS_IF([test "$with_libc_strcpy" = yes], [AC_DEFINE([WITH_LIBC_STRCPY], [1], [with strcpy replacement])]) diff --git a/src/arch/i386/paging.c b/src/arch/i386/paging.c deleted file mode 100644 index d367e79..0000000 --- a/src/arch/i386/paging.c +++ /dev/null @@ -1,23 +0,0 @@ -#include - -// TODO: There are some static asserts just for example. - -__attribute__((unused)) -static const int assert0[ - sizeof(struct KernAux_Arch_I386_PDE) == sizeof(uint32_t) ? 1 : -1 -]; - -__attribute__((unused)) -static const int assert1[ - sizeof(struct KernAux_Arch_I386_PTE) == sizeof(uint32_t) ? 1 : -1 -]; - -__attribute__((unused)) -static const int assert1[ - sizeof(struct KernAux_Arch_I386_PageDir) == 1024 * sizeof(uint32_t) ? 1 : -1 -]; - -__attribute__((unused)) -static const int assert1[ - sizeof(struct KernAux_Arch_I386_PageTable) == 1024 * sizeof(uint32_t) ? 1 : -1 -]; diff --git a/src/console.c b/src/console.c index 8916494..0140418 100644 --- a/src/console.c +++ b/src/console.c @@ -17,7 +17,7 @@ void kernaux_console_print(const char *const s) void kernaux_console_putc(const char c __attribute__((unused))) { -#if defined(ARCH_I386) && defined(WITH_ARCH_I386) +#ifdef ARCH_I386 kernaux_arch_i386_outportb(0x3F8, c); #endif } diff --git a/tests/test_arch_i386_paging.c b/tests/test_arch_i386_paging.c deleted file mode 100644 index a572831..0000000 --- a/tests/test_arch_i386_paging.c +++ /dev/null @@ -1,32 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -// TODO: There are some static asserts just for example. - -__attribute__((unused)) -static const int assert0[ - sizeof(struct KernAux_Arch_I386_PDE) == sizeof(uint32_t) ? 1 : -1 -]; - -__attribute__((unused)) -static const int assert1[ - sizeof(struct KernAux_Arch_I386_PTE) == sizeof(uint32_t) ? 1 : -1 -]; - -__attribute__((unused)) -static const int assert1[ - sizeof(struct KernAux_Arch_I386_PageDir) == 1024 * sizeof(uint32_t) ? 1 : -1 -]; - -__attribute__((unused)) -static const int assert1[ - sizeof(struct KernAux_Arch_I386_PageTable) == 1024 * sizeof(uint32_t) ? 1 : -1 -]; - -int main() -{ - return 0; -}