Skip to content

Commit

Permalink
Merge pull request #1803 from ghaerr/df
Browse files Browse the repository at this point in the history
[build,df] Various minor fixups
  • Loading branch information
ghaerr authored Feb 7, 2024
2 parents f49c5b6 + af86ac9 commit bb9e196
Show file tree
Hide file tree
Showing 24 changed files with 43 additions and 95 deletions.
20 changes: 13 additions & 7 deletions elks/arch/i86/drivers/block/directfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
#define MAJOR_NR FLOPPY_MAJOR
#include "blk.h"

#ifndef CONFIG_ASYNCIO
#error Direct FD driver requires CONFIG_ASYNCIO
#endif

/*
* The original 8272A doesn't have FD_DOR, FD_DIR or FD_CCR registers,
* but the 82077 found on modern clones can be configured in hardware
Expand Down Expand Up @@ -127,13 +131,15 @@
//#define DEBUG printk
#define DEBUG(...)

#define bool unsigned char /* don't require stdbool.h yet */

static void (*do_floppy)(); /* interrupt routine to call */
static int initial_reset_flag;
static int need_configure = 1; /* for 82077 */
static int reset; /* something went wrong, reset FDC, start over */
static int recalibrate; /* seek errors, etc, eventually triggers recalibrate_floppy */
static int recover; /* recovering from hang, awakened by watchdog timer */
static int seek; /* set if current op needs a track change (seek) */
static bool initial_reset_flag;
static bool need_configure = 1; /* for 82077 */
static bool reset; /* something went wrong, reset FDC, start over */
static bool recalibrate; /* seek errors, etc, eventually triggers recalibrate_floppy */
static bool recover; /* recovering from hang, awakened by watchdog timer */
static bool seek; /* set if current op needs a track change (seek) */

/* BIOS floppy motor timeout counter - FIXME leave this while BIOS driver present */
static unsigned char __far *fl_timeout = (void __far *)0x440L;
Expand All @@ -143,7 +149,7 @@ static unsigned char __far *fl_timeout = (void __far *)0x440L;
* with typical spinup time of .5 secs.
*/
static unsigned char current_DOR;
static unsigned char running = 0; /* keep track of motors already running */
static unsigned char running; /* keep track of motors already running */
/*
* Note that MAX_ERRORS=X doesn't imply that we retry every bad read
* max X times - some types of errors increase the errorcount by 2 or
Expand Down
8 changes: 0 additions & 8 deletions elks/include/arch/hdreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

/* remainder is shared between hd.c, ide.c, ide-cd.c, and the hdparm utility */

/*@-namechecks@*/

/* Bits of HD_STATUS */
#define ERR_STAT 0x01
#define INDEX_STAT 0x02
Expand All @@ -36,8 +34,6 @@
#define READY_STAT 0x40
#define BUSY_STAT 0x80

/*@+namechecks@*/

/* Values for HD_COMMAND */
#define WIN_RESTORE 0x10
#define WIN_READ 0x20
Expand Down Expand Up @@ -67,8 +63,6 @@
#define WIN_SRST 0x08 /* ATAPI soft reset command */
#define WIN_PACKETCMD 0xa0 /* Send a packet command. */

/*@-namechecks@*/

/* Bits for HD_ERROR */
#define MARK_ERR 0x01 /* Bad address mark */
#define TRK0_ERR 0x02 /* couldn't find track 0 */
Expand All @@ -77,8 +71,6 @@
#define ECC_ERR 0x40 /* Uncorrectable ECC error */
#define BBD_ERR 0x80 /* block marked bad */

/*@+namechecks@*/

struct hd_geometry {
unsigned char heads;
unsigned char sectors;
Expand Down
5 changes: 1 addition & 4 deletions elks/include/arch/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
#include <linuxmt/types.h>

extern __u16 kernel_cs, kernel_ds;

/*@-namechecks@*/

extern short *_endtext, *_endftext, *_enddata, *_endbss;
extern unsigned int heapsize;

#endif /* !__ARCH_8086_SEGMENT_H */
#endif
4 changes: 0 additions & 4 deletions elks/include/arch/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
* String functions for the 8086 architecture.
*/

/*@-namechecks@*/

#define __HAVE_ARCH_STRLEN
#define __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCMP
#define __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMCPY

/*@+namechecks@*/

#endif
6 changes: 3 additions & 3 deletions elks/include/arch/types.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* arch/i86/include/asm/types.h - Basic Linux/MT data types. */

#ifndef __ARCH_8086_TYPES_H
#define __ARCH_8086_TYPES_H

/* arch/i86/include/asm/types.h - Basic Linux/MT data types. */

/* First we define all of the __u and __s types...*/

#define signed
Expand Down Expand Up @@ -49,4 +49,4 @@ struct uregs {
#define NULL ((void *) 0)
#endif

#endif /* !__ARCH_8086_TYPES_H */
#endif
7 changes: 3 additions & 4 deletions elks/include/linuxmt/ctype.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#ifndef __CTYPE_H
#define __CTYPE_H
/*
* ctype.h Character classification and conversion
*/

#ifndef __CTYPE_H
#define __CTYPE_H

extern unsigned char __ctype[];

#define __CT_d 0x01 /* numeric digit */
Expand Down Expand Up @@ -38,4 +37,4 @@ extern unsigned char __ctype[];
#define isupper(c) (!!(__CT(c)&__CT_u))
#define isxdigit(c) (!!(__CT(c)&__CT_x))

#endif /* __CTYPE_H */
#endif
3 changes: 1 addition & 2 deletions elks/include/linuxmt/devnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@
#define DEV_TTYS0 MKDEV(TTY_MAJOR, 64)
#define DEV_TTYS1 MKDEV(TTY_MAJOR, 65)


#endif /* !__LINUXMT_DEVNUM_H */
#endif
10 changes: 3 additions & 7 deletions elks/include/linuxmt/errno.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#ifndef __LINUXMT_ERRNO_H
#define __LINUXMT_ERRNO_H

/* errno.h here is taken from the one in the Linux 2.5.5 kernel release.
* It consists of the include/linux/errno.h and include/asm/errno.h files
* combined into a single file.
*/

#ifndef __LINUXMT_ERRNO_H
#define __LINUXMT_ERRNO_H

/*@-namechecks@*/

/*****************************************************************************/

/* These were in Linux's include/asm/errno.h file.
Expand Down Expand Up @@ -183,6 +181,4 @@

/*****************************************************************************/

/*@+namechecks@*/

#endif
2 changes: 1 addition & 1 deletion elks/include/linuxmt/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ void heap_init ();

#ifdef HEAP_DEBUG
void heap_iterate (void (* cb) (heap_s * h));
#endif /* HEAP_DEBUG */
#endif

#endif
4 changes: 0 additions & 4 deletions elks/include/linuxmt/kd.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
# include <linuxmt/types.h>
#endif

/*@-namechecks@*/

#define __KD_MAJ ('K'<<8)

/*@+namechecks@*/

#define KIOCSOUND (__KD_MAJ + 0x2f)

#endif
2 changes: 1 addition & 1 deletion elks/include/linuxmt/limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@

#define MAX_PACKET_ETH 1536 /* Max packet size, 6 blocks of 256 bytes */

#endif /* !__LINUXMT_LIMITS_H */
#endif
3 changes: 1 addition & 2 deletions elks/include/linuxmt/major.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@
#define ATHD_MAJOR 5 /* experimental*/
#define ROMFLASH_MAJOR 6


#endif /* !__LINUXMT_MAJOR_H */
#endif
9 changes: 3 additions & 6 deletions elks/include/linuxmt/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ typedef struct segment segment_s;

#include <linuxmt/kernel.h>

/*@-namechecks@*/

void memcpy_fromfs(void *,void *,size_t);
void memcpy_tofs(void *,void *,size_t);
int strlen_fromfs(void *,size_t);

/*@+namechecks@*/

#define VERIFY_READ 0
#define VERIFY_WRITE 1

Expand Down Expand Up @@ -68,5 +64,6 @@ void seg_free_pid(pid_t pid);

void mm_get_usage (unsigned int * free, unsigned int * used);

#endif // __KERNEL__
#endif // !__LINUXMT_MM_H
#endif /* __KERNEL__ */

#endif
6 changes: 3 additions & 3 deletions elks/include/linuxmt/romfs_fs.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* ROMFS - A tiny read-only filesystem in memory */

#ifndef _LINUXMT_ROMFS_FS_H
#define _LINUXMT_ROMFS_FS_H

/* ROMFS - A tiny read-only filesystem in memory */

#define ROMFS_MAGIC 0x7275
#define ROMFS_MAGIC_STR "ROMFS"
#define ROMFS_MAGIC_LEN 6 /* even length for word compare */
Expand Down Expand Up @@ -48,4 +48,4 @@ struct romfs_inode_info {
word_t seg; /* inode segment */
};

#endif /* !_LINUXMT_ROMFS_FS_H */
#endif
10 changes: 0 additions & 10 deletions elks/include/linuxmt/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

typedef unsigned short sigset_t; /* at least 16 bits */

/*@-namechecks@*/

#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
Expand All @@ -40,14 +38,10 @@ typedef unsigned short sigset_t; /* at least 16 bits */

#define _NSIG 16

/*@+namechecks@*/

#else

typedef unsigned long sigset_t; /* at least 32 bits */

/*@-namechecks@*/

#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
Expand Down Expand Up @@ -178,8 +172,6 @@ typedef unsigned long sigset_t; /* at least 32 bits */

#endif /* __KERNEL__*/

/*@-namechecks@*/

#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
#define SIG_SETMASK 2 /* for setting the signal mask */
Expand All @@ -194,8 +186,6 @@ typedef void (*sighandler_t)(int);
typedef __attribute__((__stdcall__)) __far void (*__kern_sighandler_t)(int);
#pragma GCC diagnostic pop

/*@+namechecks@*/ /*@ignore@*/

/*
* Because this stuff can get pretty confusing:
* * SIG_DFL, SIG_IGN, and SIG_ERR are used within userland. These may be
Expand Down
4 changes: 0 additions & 4 deletions elks/include/linuxmt/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include <linuxmt/types.h>
#include <stddef.h>

/*@-namechecks@*/

/* The following prototypes all match the current GNU manpage prototypes.
* It is still to be confirmed whether these also match the declarations
* and the usage made thereof.
Expand Down Expand Up @@ -39,8 +37,6 @@ extern void *memscan(void *,int,size_t);
extern long simple_strtol(const char *,int);
extern int atoi(const char *);

/*@+namechecks@*/

/*
* Include machine specific routines
*/
Expand Down
16 changes: 0 additions & 16 deletions elks/include/linuxmt/termios.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@

#include <linuxmt/types.h>

/*@-namechecks@*/

/* This is just a magic number to make these relatively unique ('T') */
#define __TERMIOS_MAJ ('T'<<8)

/*@+namechecks@*/

#define TCGETS (__TERMIOS_MAJ+0x01)
#define TCSETS (__TERMIOS_MAJ+0x02)
#define TCSETSW (__TERMIOS_MAJ+0x03)
Expand Down Expand Up @@ -202,13 +198,9 @@ struct termios {
#define B19200 0000016
#define B38400 0000017

/*@-namechecks@*/

#define EXTA B19200
#define EXTB B38400

/*@+namechecks@*/

#define CSIZE 0000060
#define CS5 0000000
#define CS6 0000020
Expand All @@ -227,8 +219,6 @@ struct termios {
#define CIBAUD 002003600000 /* input baud rate (not used) */
#define CRTSCTS 020000000000 /* flow control */

/*@-namechecks@*/

/* c_lflag bits */
#define ISIG 0000001
#define ICANON 0000002
Expand All @@ -246,8 +236,6 @@ struct termios {
#define PENDIN 0040000
#define IEXTEN 0100000

/*@+namechecks@*/

/* modem lines */
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
Expand Down Expand Up @@ -286,10 +274,6 @@ struct termios {
#define N_MOUSE 2
#define N_PPP 3

/*@-namechecks@*/

#define _POSIX_VDISABLE '\0'

/*@+namechecks@*/

#endif
2 changes: 1 addition & 1 deletion elks/include/linuxmt/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ extern void trace_begin(void);
extern void trace_end(unsigned int retval);
#endif

#endif /* __LINUXMT_TRACE_H */
#endif
2 changes: 1 addition & 1 deletion elkscmd/Applications
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ sh_utils/xargs :shutil :1200k
sh_utils/yes :shutil :720k
misc_utils/compress :miscutil :1440k
misc_utils/miniterm :miscutil :720k
misc_utils/fdtest :miscutil :1200k
misc_utils/tar :miscutil :1200k
misc_utils/od :miscutil :1200k
misc_utils/hd :miscutil :1200k
Expand Down Expand Up @@ -187,6 +186,7 @@ inet/urlget/urlget :::ftpput :net
inet/urlget/urlget :::httpget :net
bc/bc :other
test/libc/test_libc :test
test/other/test_fd :test
test/other/test_float :test
#nano/nano-2.0.6/src/nano :other :1440k
#mtools/mcopy :other
Expand Down
1 change: 0 additions & 1 deletion elkscmd/misc_utils/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ miniterm
compress
compress.host
ed
fdtest
float
tar
od
Expand Down
Loading

0 comments on commit bb9e196

Please sign in to comment.