Skip to content

Commit

Permalink
Merge pull request #2075 from ghaerr/docs
Browse files Browse the repository at this point in the history
[docs,build] Update build.sh to stop on error, update docs on mtools, flex, bison
  • Loading branch information
ghaerr authored Oct 15, 2024
2 parents 735a98a + f14dee3 commit 3f755dd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
6 changes: 1 addition & 5 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
## Prerequisites

To build ELKS, you need a development environment on Linux or macOS or Windows with [WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux), including:
- flex
- bison
- texinfo
- libncurses5-dev
- mtools-4.0.23 (for MSDOS/FAT images)
- compress (for compressed man pages; use `sudo apt-get install ncompress`)
- texinfo

## Build steps

Expand Down Expand Up @@ -39,7 +36,6 @@ configuration, that folder is used to create either a floppy disk image
(fd360, fd720, fd1200, fd1440, fd2880), a flat 32MB hard disk image (without MBR),
or a ROM file image into the `image` folder. The image extension is '.img'
and will be in either ELKS (MINIX) or MSDOS (FAT) filesystem format.
Building FAT images requires the 'mtools-4.0.23' package to be installed.

6- Before writing that image on the real medium, you can test it first on QEMU:

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV USER=builder \
WORKDIR /elks
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
flex bison texinfo libncurses5-dev \
texinfo libncurses5-dev \
bash make g++ git libelf-dev patch \
xxd ca-certificates wget mtools \
&& rm -r /var/lib/apt/lists /var/cache/apt/archives \
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# Arguments:
# - 'auto' : continuous integration context
set -e

SCRIPTDIR="$(dirname "$0")"

Expand Down
1 change: 0 additions & 1 deletion libc/misc/atoi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <stdlib.h>
#include <ctype.h>

int atoi(const char *s)
{
Expand Down
23 changes: 11 additions & 12 deletions libc/misc/atol.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#include <stdlib.h>
#include <ctype.h>

long atol(const char *s)
{
long n = 0;
int neg = 0;
long n = 0;
int neg = 0;

while (*s == ' ' || *s == '\t')
s++;
switch (*s) {
case '-': neg = 1;
case '+': s++;
}
while ((unsigned) (*s - '0') <= 9u)
n = n * 10 + *s++ - '0';
return neg ? 0u - n : n;
while (*s == ' ' || *s == '\t')
s++;
switch (*s) {
case '-': neg = 1;
case '+': s++;
}
while ((unsigned) (*s - '0') <= 9u)
n = n * 10 + *s++ - '0';
return neg ? 0u - n : n;
}

0 comments on commit 3f755dd

Please sign in to comment.