* [PATCH] Changes to reduce warnings using ia16-unknown-elks-gcc
@ 2015-06-02 5:10 Juan Perez-Sanchez
2015-06-02 15:10 ` Juan Perez-Sanchez
0 siblings, 1 reply; 4+ messages in thread
From: Juan Perez-Sanchez @ 2015-06-02 5:10 UTC (permalink / raw)
To: linux-8086
[-- Attachment #1: Type: text/plain, Size: 263 bytes --]
Hi,
Attached is a patch to:
-Reduce warnings using ia16-unknown-elks-gcc
-Elimination of inline assembly within several C functions.
-Fixed prototypes of several functions.
-Simplifyed file arch/i86/drivers/char/bell.c.
Code and data size was unchanged.
Juan
[-- Attachment #2: elks-3y.patch --]
[-- Type: text/x-patch, Size: 9475 bytes --]
diff -Nur elks.orig/arch/i86/drivers/char/bell.c elks/arch/i86/drivers/char/bell.c
--- elks.orig/arch/i86/drivers/char/bell.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/drivers/char/bell.c 2015-06-01 14:18:29.000000000 -0500
@@ -8,39 +8,30 @@
#include <arch/io.h>
+#define BELL_FREQUENCY 800
+#define BELL_PERIOD (1193181/BELL_FREQUENCY)
+#define BELL_PERIOD_L (BELL_PERIOD & 0xFF)
+#define BELL_PERIOD_H (BELL_PERIOD / 256)
+#define SPEAKER_PORT (0x61)
+#define TIMER2_PORT (0x42)
+#define TIMER_CONTROL_PORT (0x43)
+
/*
* Turn PC speaker on at specified frequency.
*/
-static void sound(unsigned freq)
+static void sound(void)
{
- int es;
-#ifndef S_SPLINT_S
-#asm
- mov bx, [bp+.sound.freq] ! frequency
- mov ax, #$34dd
- mov dx, #$0012
- cmp dx, bx
- jnb none
- div bx
- mov bx, ax
- in al, $61
- test al, #3
- jne j1
- or al, #3
- out $61, al
-
-j1:
- mov al, #$b6
- out $43, al
- mov al, bl
- out $42, al
- mov al, bh
- out $42, al
-
-none:
-
-#endasm
-#endif
+ asm(\
+ "\tin al,0x61\n" \
+ "\tor al,#3\n" \
+ "\tout 0x61,al\n" \
+ "\tmov al,#0xB6\n" \
+ "\tout 0x43,al\n" \
+ "\tmov al,#0xD3\n" \
+ "\tout 0x42,al\n" \
+ "\tmov al,#0x05\n" \
+ "\tout 0x42,al\n" \
+ );
}
/*
@@ -48,13 +39,11 @@
*/
static void nosound(void)
{
-#ifndef S_SPLINT_S
-#asm
- in al, $61
- and al, #$fc
- out $61, al
-#endasm
-#endif
+ asm(\
+ "\tin al,0x61\n" \
+ "\tand al,#0xFC\n" \
+ "\tout 0x61,al\n" \
+ );
}
/*
@@ -64,8 +53,8 @@
{
register char *pi = (char *) 60000U;
- sound(800);
- while (--pi)
+ sound();
+ while (--pi)
/* Do nothing */ ;
nosound();
}
diff -Nur elks.orig/arch/i86/drivers/char/ntty.c elks/arch/i86/drivers/char/ntty.c
--- elks.orig/arch/i86/drivers/char/ntty.c 2015-06-01 18:34:18.000000000 -0500
+++ elks/arch/i86/drivers/char/ntty.c 2015-06-01 14:18:29.000000000 -0500
@@ -101,7 +101,7 @@
err = otty->ops->open(otty);
if (err)
return err;
- if (otty->pgrp == NULL && currentp->session == currentp->pid
+ if (otty->pgrp == 0 && currentp->session == currentp->pid
&& currentp->tty == NULL) {
otty->pgrp = currentp->pgrp;
currentp->tty = otty;
diff -Nur elks.orig/arch/i86/kernel/asm-offsets.c elks/arch/i86/kernel/asm-offsets.c
--- elks.orig/arch/i86/kernel/asm-offsets.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/asm-offsets.c 2015-06-01 14:18:29.000000000 -0500
@@ -7,7 +7,8 @@
#ifdef __WATCOMC__
#define offsetof(__typ,__id) ((size_t)((char *)&(((__typ*)0)->__id) - (char *)0))
#else
-#include <stddef.h>
+#define offsetof(s,m) (size_t)&(((s *)0)->m)
+/*#include <stddef.h>*/
#endif
#endif
diff -Nur elks.orig/arch/i86/kernel/mkentry.sh elks/arch/i86/kernel/mkentry.sh
--- elks.orig/arch/i86/kernel/mkentry.sh 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/mkentry.sh 2015-06-01 17:10:13.000000000 -0500
@@ -69,7 +69,7 @@
if( depends_on[callno] != "" )
{
- if( callno <= maxstd )
+ if( callno < maxstd )
{
str = "\t.word _no_syscall";
printf "#else\n%-25s ! %3d - %s\n", str, callno, assigned_to[callno]
@@ -90,10 +90,11 @@
.text
.globl _syscall
+ .globl _no_syscall
_syscall:
cmp ax,#((sys_call_table_end - sys_call_table)/2)
- ja _nsyscall
+ ja _no_syscall
! look up address and jump to function
mov bx,ax
add bx,ax ! multiply by 2
@@ -101,8 +102,9 @@
! All unimplemented calls
-_nsyscall:
- br _no_syscall
+_no_syscall:
+ mov ax,#-38
+ ret
#endasm
#endif
diff -Nur elks.orig/arch/i86/kernel/printreg.c elks/arch/i86/kernel/printreg.c
--- elks.orig/arch/i86/kernel/printreg.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/printreg.c 2015-06-01 14:18:29.000000000 -0500
@@ -43,19 +43,10 @@
pop ss
pop bp
ret
-#endasm
-#endif
-void printsp(void)
-{
-#ifndef S_SPLINT_S
-#asm
-
- .data
-msg: .ascii "SP=%x:%x\n"
- .byte 0
+ .globl _printsp
- .text
+_printsp:
push sp
push ss
push #msg
@@ -65,6 +56,9 @@
pop ax
ret
+ .data
+msg: .ascii "SP=%x:%x\n"
+ .byte 0
+
#endasm
#endif
-}
diff -Nur elks.orig/arch/i86/kernel/syscall.dat elks/arch/i86/kernel/syscall.dat
--- elks.orig/arch/i86/kernel/syscall.dat 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/syscall.dat 2015-06-01 18:57:31.000000000 -0500
@@ -60,7 +60,7 @@
mkdir +39 2
rmdir +40 1
dup +41 1 . There is a fcntl lib function too.
-pipe +42 1
+pipe +42 1 = CONFIG_PIPE
times 43 2 * 2nd arg is pointer for long ret val.
profil 44 4 @
dup2 +45 2
@@ -81,18 +81,18 @@
umask +60 1
settimeofday +61 2
gettimeofday +62 2
-select +63 5 . 5 paramaters is possible
+select +63 5 . 5 paramaters is possible
readdir +64 3 *
insmod 65 1 - Removed support for modules
fchown +66 3
-dlload +67 2
+dlload +67 2 - Removed support for dynamic libraries
setsid +68 0
-socket +69 3
-bind +70 3
-listen +71 2
-accept +72 3
-connect +73 3
-knlvsn +74 1 = CONFIG_SYS_VERSION
+socket +69 3 = CONFIG_SOCKET
+bind +70 3 = CONFIG_SOCKET
+listen +71 2 = CONFIG_SOCKET
+accept +72 3 = CONFIG_SOCKET
+connect +73 3 = CONFIG_SOCKET
+knlvsn +74 1 = CONFIG_SYS_VERSION
#
# Name No Args Flag&comment
#
diff -Nur elks.orig/arch/i86/kernel/system.c elks/arch/i86/kernel/system.c
--- elks.orig/arch/i86/kernel/system.c 2015-06-01 18:34:28.000000000 -0500
+++ elks/arch/i86/kernel/system.c 2015-06-01 17:23:05.000000000 -0500
@@ -12,21 +12,6 @@
extern long int basmem;
#endif
-/* Stubs for functions needed elsewhere */
-
-void hard_reset_now(void)
-{
-#ifndef S_SPLINT_S
-#asm
- mov ax,#0x40 ! No memory check on reboot
- mov ds, ax
- mov [0x72],#0x1234
- jmp #0xffff:0
-
-#endasm
-#endif
-}
-
void setup_arch(seg_t *start, seg_t *end)
{
#ifdef CONFIG_COMPAQ_FAST
@@ -49,7 +34,7 @@
#ifndef CONFIG_ARCH_SIBO
- *end = (seg_t)(setupw(0x2a) << 6 - RAM_REDUCE);
+ *end = (seg_t)((setupw(0x2a) << 6) - RAM_REDUCE);
/* XXX plac: free root ram disk */
@@ -70,42 +55,18 @@
}
+/* Stubs for functions needed elsewhere */
+
#ifndef S_SPLINT_S
#asm
+ export _hard_reset_now
- export _sys_dlload
-
-_sys_dlload:
-
-#ifndef CONFIG_SOCKET
+_hard_reset_now:
- export _sys_socket
-
-_sys_socket:
-
- export _sys_bind
-
-_sys_bind:
-
- export _sys_listen
-
-_sys_listen:
-
- export _sys_accept
-
-_sys_accept:
-
- export _sys_connect
-
-_sys_connect:
-
-#endif
-
- export _no_syscall
-
-_no_syscall:
- mov ax,#-38
- ret
+ mov ax,#0x40 ! No memory check on reboot
+ mov ds, ax
+ mov [0x72],#0x1234
+ jmp #0xffff:0
#endasm
#endif
diff -Nur elks.orig/fs/minix/dir.c elks/fs/minix/dir.c
--- elks.orig/fs/minix/dir.c 2015-06-01 18:34:09.000000000 -0500
+++ elks/fs/minix/dir.c 2015-06-01 14:18:29.000000000 -0500
@@ -16,7 +16,7 @@
#include <arch/segment.h>
-static size_t minix_dir_read(struct inode *inode, struct file *filp, char *buf, int count)
+static size_t minix_dir_read(struct inode *inode,struct file *filp,char *buf,size_t count)
{
return -EISDIR;
}
diff -Nur elks.orig/fs/pipe.c elks/fs/pipe.c
--- elks.orig/fs/pipe.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/fs/pipe.c 2015-06-01 17:43:02.000000000 -0500
@@ -407,11 +407,4 @@
return verified_memcpy_tofs(filedes, fd, 2 * sizeof(int));
}
-#else
-
-int sys_pipe(unsigned int *filedes)
-{
- return -ENOSYS;
-}
-
#endif
diff -Nur elks.orig/include/arch/io.h elks/include/arch/io.h
--- elks.orig/include/arch/io.h 2015-06-01 18:34:28.000000000 -0500
+++ elks/include/arch/io.h 2015-06-01 14:18:29.000000000 -0500
@@ -1,6 +1,8 @@
#ifndef LX86_ARCH_IO_H
#define LX86_ARCH_IO_H
+extern void bell(void);
+
#ifdef __BCC__
extern void outb(unsigned char, void *);
extern void outb_p(unsigned char, void *);
@@ -12,8 +14,55 @@
extern unsigned short int inw(void *);
extern unsigned short int inw_p(void *);
+#endif
+
+#ifdef __ia16__
+#define outb(value,port) \
+__asm__ ("outb %%al,%%dx"::"a" (value),"d" (port))
+
+
+#define inb(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inb %%dx,%%al":"=a" (_v):"d" (port)); \
+_v; \
+})
+
+#define outw(value,port) \
+__asm__ ("outw %%ax,%%dx"::"a" (value),"d" (port))
+
+
+#define inw(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inw %%dx,%%ax":"=a" (_v):"d" (port)); \
+_v; \
+})
+
+#define outb_p(value,port) \
+__asm__ volatile ("outb %%al,%%dx\n" \
+ "outb %%al,$0x80\n" \
+ ::"a" (value),"d" (port))
+
+#define inb_p(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inb %%dx,%%al\n" \
+ "outb %%al,$0x80\n" \
+ :"=a" (_v):"d" (port)); \
+_v; \
+})
+
+#define outw_p(value,port) \
+__asm__ volatile ("outw %%ax,%%dx\n" \
+ "outb %%al,$0x80\n" \
+ ::"a" (value),"d" (port))
+
+#define inw_p(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inw %%dx,%%ax\n" \
+ "outb %%al,$0x80\n" \
+ :"=a" (_v):"d" (port)); \
+_v; \
+})
-extern void bell(void);
#endif
#ifdef __WATCOMC__
diff -Nur elks.orig/include/linuxmt/fs.h elks/include/linuxmt/fs.h
--- elks.orig/include/linuxmt/fs.h 2015-06-01 18:34:18.000000000 -0500
+++ elks/include/linuxmt/fs.h 2015-06-01 14:18:29.000000000 -0500
@@ -303,8 +303,8 @@
struct file_operations {
loff_t (*lseek) ();
- size_t (*read) ();
- size_t (*write) ();
+ size_t (*read)(struct inode *,struct file *,char *,size_t);
+ size_t (*write)(struct inode *,struct file *,char *,size_t);
int (*readdir) ();
int (*select) ();
int (*ioctl) ();
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Changes to reduce warnings using ia16-unknown-elks-gcc
2015-06-02 5:10 [PATCH] Changes to reduce warnings using ia16-unknown-elks-gcc Juan Perez-Sanchez
@ 2015-06-02 15:10 ` Juan Perez-Sanchez
2015-06-13 14:25 ` Jody Bruchon
2015-06-13 14:53 ` Jody Bruchon
0 siblings, 2 replies; 4+ messages in thread
From: Juan Perez-Sanchez @ 2015-06-02 15:10 UTC (permalink / raw)
To: linux-8086
[-- Attachment #1: Type: text/plain, Size: 113 bytes --]
The previous patch has a problem. Attached to this mail is the correct
patch. Sorry for the inconvenience.
Juan
[-- Attachment #2: elks-3y.patch --]
[-- Type: text/x-patch, Size: 9666 bytes --]
diff -Nur elks.orig/arch/i86/drivers/char/bell.c elks/arch/i86/drivers/char/bell.c
--- elks.orig/arch/i86/drivers/char/bell.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/drivers/char/bell.c 2015-06-01 14:18:29.000000000 -0500
@@ -8,39 +8,30 @@
#include <arch/io.h>
+#define BELL_FREQUENCY 800
+#define BELL_PERIOD (1193181/BELL_FREQUENCY)
+#define BELL_PERIOD_L (BELL_PERIOD & 0xFF)
+#define BELL_PERIOD_H (BELL_PERIOD / 256)
+#define SPEAKER_PORT (0x61)
+#define TIMER2_PORT (0x42)
+#define TIMER_CONTROL_PORT (0x43)
+
/*
* Turn PC speaker on at specified frequency.
*/
-static void sound(unsigned freq)
+static void sound(void)
{
- int es;
-#ifndef S_SPLINT_S
-#asm
- mov bx, [bp+.sound.freq] ! frequency
- mov ax, #$34dd
- mov dx, #$0012
- cmp dx, bx
- jnb none
- div bx
- mov bx, ax
- in al, $61
- test al, #3
- jne j1
- or al, #3
- out $61, al
-
-j1:
- mov al, #$b6
- out $43, al
- mov al, bl
- out $42, al
- mov al, bh
- out $42, al
-
-none:
-
-#endasm
-#endif
+ asm(\
+ "\tin al,0x61\n" \
+ "\tor al,#3\n" \
+ "\tout 0x61,al\n" \
+ "\tmov al,#0xB6\n" \
+ "\tout 0x43,al\n" \
+ "\tmov al,#0xD3\n" \
+ "\tout 0x42,al\n" \
+ "\tmov al,#0x05\n" \
+ "\tout 0x42,al\n" \
+ );
}
/*
@@ -48,13 +39,11 @@
*/
static void nosound(void)
{
-#ifndef S_SPLINT_S
-#asm
- in al, $61
- and al, #$fc
- out $61, al
-#endasm
-#endif
+ asm(\
+ "\tin al,0x61\n" \
+ "\tand al,#0xFC\n" \
+ "\tout 0x61,al\n" \
+ );
}
/*
@@ -64,8 +53,8 @@
{
register char *pi = (char *) 60000U;
- sound(800);
- while (--pi)
+ sound();
+ while (--pi)
/* Do nothing */ ;
nosound();
}
diff -Nur elks.orig/arch/i86/drivers/char/ntty.c elks/arch/i86/drivers/char/ntty.c
--- elks.orig/arch/i86/drivers/char/ntty.c 2015-06-01 18:34:18.000000000 -0500
+++ elks/arch/i86/drivers/char/ntty.c 2015-06-01 14:18:29.000000000 -0500
@@ -101,7 +101,7 @@
err = otty->ops->open(otty);
if (err)
return err;
- if (otty->pgrp == NULL && currentp->session == currentp->pid
+ if (otty->pgrp == 0 && currentp->session == currentp->pid
&& currentp->tty == NULL) {
otty->pgrp = currentp->pgrp;
currentp->tty = otty;
diff -Nur elks.orig/arch/i86/kernel/asm-offsets.c elks/arch/i86/kernel/asm-offsets.c
--- elks.orig/arch/i86/kernel/asm-offsets.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/asm-offsets.c 2015-06-01 14:18:29.000000000 -0500
@@ -7,7 +7,8 @@
#ifdef __WATCOMC__
#define offsetof(__typ,__id) ((size_t)((char *)&(((__typ*)0)->__id) - (char *)0))
#else
-#include <stddef.h>
+#define offsetof(s,m) (size_t)&(((s *)0)->m)
+/*#include <stddef.h>*/
#endif
#endif
diff -Nur elks.orig/arch/i86/kernel/mkentry.sh elks/arch/i86/kernel/mkentry.sh
--- elks.orig/arch/i86/kernel/mkentry.sh 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/mkentry.sh 2015-06-01 17:10:13.000000000 -0500
@@ -3,6 +3,7 @@
# This program generates entry.c from syscall.dat
cat << .eof
+#include <linuxmt/config.h>
/* Switched to V7 system call layout... Chad - 1/5/96
*/
#ifndef S_SPLINT_S
@@ -69,7 +70,7 @@
if( depends_on[callno] != "" )
{
- if( callno <= maxstd )
+ if( callno < maxstd )
{
str = "\t.word _no_syscall";
printf "#else\n%-25s ! %3d - %s\n", str, callno, assigned_to[callno]
@@ -90,10 +91,11 @@
.text
.globl _syscall
+ .globl _no_syscall
_syscall:
cmp ax,#((sys_call_table_end - sys_call_table)/2)
- ja _nsyscall
+ ja _no_syscall
! look up address and jump to function
mov bx,ax
add bx,ax ! multiply by 2
@@ -101,8 +103,9 @@
! All unimplemented calls
-_nsyscall:
- br _no_syscall
+_no_syscall:
+ mov ax,#-38
+ ret
#endasm
#endif
diff -Nur elks.orig/arch/i86/kernel/printreg.c elks/arch/i86/kernel/printreg.c
--- elks.orig/arch/i86/kernel/printreg.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/printreg.c 2015-06-01 14:18:29.000000000 -0500
@@ -43,19 +43,10 @@
pop ss
pop bp
ret
-#endasm
-#endif
-void printsp(void)
-{
-#ifndef S_SPLINT_S
-#asm
-
- .data
-msg: .ascii "SP=%x:%x\n"
- .byte 0
+ .globl _printsp
- .text
+_printsp:
push sp
push ss
push #msg
@@ -65,6 +56,9 @@
pop ax
ret
+ .data
+msg: .ascii "SP=%x:%x\n"
+ .byte 0
+
#endasm
#endif
-}
diff -Nur elks.orig/arch/i86/kernel/syscall.dat elks/arch/i86/kernel/syscall.dat
--- elks.orig/arch/i86/kernel/syscall.dat 2015-04-26 11:39:15.000000000 -0500
+++ elks/arch/i86/kernel/syscall.dat 2015-06-01 18:57:31.000000000 -0500
@@ -60,7 +60,7 @@
mkdir +39 2
rmdir +40 1
dup +41 1 . There is a fcntl lib function too.
-pipe +42 1
+pipe +42 1 = CONFIG_PIPE
times 43 2 * 2nd arg is pointer for long ret val.
profil 44 4 @
dup2 +45 2
@@ -81,18 +81,18 @@
umask +60 1
settimeofday +61 2
gettimeofday +62 2
-select +63 5 . 5 paramaters is possible
+select +63 5 . 5 paramaters is possible
readdir +64 3 *
insmod 65 1 - Removed support for modules
fchown +66 3
-dlload +67 2
+dlload +67 2 - Removed support for dynamic libraries
setsid +68 0
-socket +69 3
-bind +70 3
-listen +71 2
-accept +72 3
-connect +73 3
-knlvsn +74 1 = CONFIG_SYS_VERSION
+socket +69 3 = CONFIG_SOCKET
+bind +70 3 = CONFIG_SOCKET
+listen +71 2 = CONFIG_SOCKET
+accept +72 3 = CONFIG_SOCKET
+connect +73 3 = CONFIG_SOCKET
+knlvsn +74 1 = CONFIG_SYS_VERSION
#
# Name No Args Flag&comment
#
diff -Nur elks.orig/arch/i86/kernel/system.c elks/arch/i86/kernel/system.c
--- elks.orig/arch/i86/kernel/system.c 2015-06-01 18:34:28.000000000 -0500
+++ elks/arch/i86/kernel/system.c 2015-06-01 17:23:05.000000000 -0500
@@ -12,21 +12,6 @@
extern long int basmem;
#endif
-/* Stubs for functions needed elsewhere */
-
-void hard_reset_now(void)
-{
-#ifndef S_SPLINT_S
-#asm
- mov ax,#0x40 ! No memory check on reboot
- mov ds, ax
- mov [0x72],#0x1234
- jmp #0xffff:0
-
-#endasm
-#endif
-}
-
void setup_arch(seg_t *start, seg_t *end)
{
#ifdef CONFIG_COMPAQ_FAST
@@ -49,7 +34,7 @@
#ifndef CONFIG_ARCH_SIBO
- *end = (seg_t)(setupw(0x2a) << 6 - RAM_REDUCE);
+ *end = (seg_t)((setupw(0x2a) << 6) - RAM_REDUCE);
/* XXX plac: free root ram disk */
@@ -70,42 +55,18 @@
}
+/* Stubs for functions needed elsewhere */
+
#ifndef S_SPLINT_S
#asm
+ export _hard_reset_now
- export _sys_dlload
-
-_sys_dlload:
-
-#ifndef CONFIG_SOCKET
+_hard_reset_now:
- export _sys_socket
-
-_sys_socket:
-
- export _sys_bind
-
-_sys_bind:
-
- export _sys_listen
-
-_sys_listen:
-
- export _sys_accept
-
-_sys_accept:
-
- export _sys_connect
-
-_sys_connect:
-
-#endif
-
- export _no_syscall
-
-_no_syscall:
- mov ax,#-38
- ret
+ mov ax,#0x40 ! No memory check on reboot
+ mov ds, ax
+ mov [0x72],#0x1234
+ jmp #0xffff:0
#endasm
#endif
diff -Nur elks.orig/fs/minix/dir.c elks/fs/minix/dir.c
--- elks.orig/fs/minix/dir.c 2015-06-01 18:34:09.000000000 -0500
+++ elks/fs/minix/dir.c 2015-06-01 14:18:29.000000000 -0500
@@ -16,7 +16,7 @@
#include <arch/segment.h>
-static size_t minix_dir_read(struct inode *inode, struct file *filp, char *buf, int count)
+static size_t minix_dir_read(struct inode *inode,struct file *filp,char *buf,size_t count)
{
return -EISDIR;
}
diff -Nur elks.orig/fs/pipe.c elks/fs/pipe.c
--- elks.orig/fs/pipe.c 2015-04-26 11:39:15.000000000 -0500
+++ elks/fs/pipe.c 2015-06-01 17:43:02.000000000 -0500
@@ -407,11 +407,4 @@
return verified_memcpy_tofs(filedes, fd, 2 * sizeof(int));
}
-#else
-
-int sys_pipe(unsigned int *filedes)
-{
- return -ENOSYS;
-}
-
#endif
diff -Nur elks.orig/include/arch/io.h elks/include/arch/io.h
--- elks.orig/include/arch/io.h 2015-06-01 18:34:28.000000000 -0500
+++ elks/include/arch/io.h 2015-06-01 14:18:29.000000000 -0500
@@ -1,6 +1,8 @@
#ifndef LX86_ARCH_IO_H
#define LX86_ARCH_IO_H
+extern void bell(void);
+
#ifdef __BCC__
extern void outb(unsigned char, void *);
extern void outb_p(unsigned char, void *);
@@ -12,8 +14,55 @@
extern unsigned short int inw(void *);
extern unsigned short int inw_p(void *);
+#endif
+
+#ifdef __ia16__
+#define outb(value,port) \
+__asm__ ("outb %%al,%%dx"::"a" (value),"d" (port))
+
+
+#define inb(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inb %%dx,%%al":"=a" (_v):"d" (port)); \
+_v; \
+})
+
+#define outw(value,port) \
+__asm__ ("outw %%ax,%%dx"::"a" (value),"d" (port))
+
+
+#define inw(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inw %%dx,%%ax":"=a" (_v):"d" (port)); \
+_v; \
+})
+
+#define outb_p(value,port) \
+__asm__ volatile ("outb %%al,%%dx\n" \
+ "outb %%al,$0x80\n" \
+ ::"a" (value),"d" (port))
+
+#define inb_p(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inb %%dx,%%al\n" \
+ "outb %%al,$0x80\n" \
+ :"=a" (_v):"d" (port)); \
+_v; \
+})
+
+#define outw_p(value,port) \
+__asm__ volatile ("outw %%ax,%%dx\n" \
+ "outb %%al,$0x80\n" \
+ ::"a" (value),"d" (port))
+
+#define inw_p(port) ({ \
+unsigned char _v; \
+__asm__ volatile ("inw %%dx,%%ax\n" \
+ "outb %%al,$0x80\n" \
+ :"=a" (_v):"d" (port)); \
+_v; \
+})
-extern void bell(void);
#endif
#ifdef __WATCOMC__
diff -Nur elks.orig/include/linuxmt/fs.h elks/include/linuxmt/fs.h
--- elks.orig/include/linuxmt/fs.h 2015-06-01 18:34:18.000000000 -0500
+++ elks/include/linuxmt/fs.h 2015-06-01 14:18:29.000000000 -0500
@@ -303,8 +303,8 @@
struct file_operations {
loff_t (*lseek) ();
- size_t (*read) ();
- size_t (*write) ();
+ size_t (*read)(struct inode *,struct file *,char *,size_t);
+ size_t (*write)(struct inode *,struct file *,char *,size_t);
int (*readdir) ();
int (*select) ();
int (*ioctl) ();
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Changes to reduce warnings using ia16-unknown-elks-gcc
2015-06-02 15:10 ` Juan Perez-Sanchez
@ 2015-06-13 14:25 ` Jody Bruchon
2015-06-13 14:53 ` Jody Bruchon
1 sibling, 0 replies; 4+ messages in thread
From: Jody Bruchon @ 2015-06-13 14:25 UTC (permalink / raw)
To: ELKS
On 2015/06/02 11:10, Juan Perez-Sanchez wrote:
> The previous patch has a problem. Attached to this mail is the correct
> patch. Sorry for the inconvenience.
>
> Juan
>
This patch causes ELKS to fail to build due to missing symbols. Make
sure you run 'make clean' in the elks/elks directory (better yet, run
'./build.sh clean') before you run a test build to reset the build state.
Can you fix it back up and send me a patch? I've already committed all
your patches to my repo and I'll send it up to Github in case you want
to sync with what I've got. Here's the failure output:
make[3]: Leaving directory
`/home/daivox/projects/github/elks/elks/arch/i86/lib'
(cd ../.. ; ld86 -0 -i -t -M \
arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a
fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a
arch/i86/mm/mm.a arch/i86/drivers/char/chr_drv.a
arch/i86/drivers/block/blk_drv.a \
-o arch/i86/boot/system > System.tmp ; \
sort -k4 System.tmp > System.map ; rm -f System.tmp )
undefined symbol: _sys_dlload
undefined symbol: _no_syscall
tools/build boot/bootsect boot/setup boot/system > boot/Image
Root device is (3, -128)
Boot sector 512 bytes.
Setup is 1660 bytes.
Unable to open 'system'
make[2]: *** [Image] Error 1
make[2]: Leaving directory `/home/daivox/projects/github/elks/elks/arch/i86'
make[1]: *** [Image] Error 2
make[1]: Leaving directory `/home/daivox/projects/github/elks/elks'
make: *** [elks] Error 2
Build script has terminated with error 4
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Changes to reduce warnings using ia16-unknown-elks-gcc
2015-06-02 15:10 ` Juan Perez-Sanchez
2015-06-13 14:25 ` Jody Bruchon
@ 2015-06-13 14:53 ` Jody Bruchon
1 sibling, 0 replies; 4+ messages in thread
From: Jody Bruchon @ 2015-06-13 14:53 UTC (permalink / raw)
To: ELKS
On 2015/06/02 11:10, Juan Perez-Sanchez wrote:
> The previous patch has a problem. Attached to this mail is the correct
> patch. Sorry for the inconvenience.
>
> Juan
>
Never mind; I figured out what was broken and fixed it. The system call
table was not being correctly deleted during 'make clean' and rebuilt,
leaving a stale copy lying around and causing the problem. The fix is
already committed in git. I highly recommend anyone trying to build ELKS
pull the changed version as soon as possible.
-Jody
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-13 14:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 5:10 [PATCH] Changes to reduce warnings using ia16-unknown-elks-gcc Juan Perez-Sanchez
2015-06-02 15:10 ` Juan Perez-Sanchez
2015-06-13 14:25 ` Jody Bruchon
2015-06-13 14:53 ` Jody Bruchon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox