linux-8086.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juan Perez-Sanchez <lithoxs@gmail.com>
To: linux-8086 <linux-8086@vger.kernel.org>
Subject: [PATCH 2 of 5] Improved ansi C compatibility
Date: Tue, 8 May 2012 01:29:04 -0500	[thread overview]
Message-ID: <CAD6VGubJxJzULWYTw9amFUYo5TG5fJ7-eP-0PAP=-04R8t0tsQ@mail.gmail.com> (raw)

Hi,

 This patch aims to improve ansi C compatibility. That is, on the issues
addressed by this patch, bcc does not flag any error, but any ansi C
compiler will produce an error and will terminate compilation.

 If we ever want to use ELKS with other processors, will likely need to
use an ansi C compiler.

 The errors corrected with this patch were found attempting to build ELKS
using gcc (instead of bcc). This patch fixes numerous straigthforward
errors.

 The Image builded without errors. The kernel was tested with QEMU and
dioscuri emulators. Also in a PPro pc booting from floppy.

Greetings,

Juan

diff -Nurb elks.orig/include/linuxmt/fs.h elks/include/linuxmt/fs.h
--- elks.orig/include/linuxmt/fs.h      2002-05-30 12:26:11.000000000 -0500
+++ elks/include/linuxmt/fs.h   2011-12-13 10:28:47.000000000 -0600
@@ -401,7 +401,7 @@

 extern int register_chrdev(unsigned int,char *,struct file_operations *);
 extern int unregister_chrdev(void);
-extern int chrdev_open(struct inode *,struct file *);
+/* extern int chrdev_open(struct inode *,struct file *); */

 extern struct file_operations def_chr_fops;
 extern struct inode_operations chrdev_inode_operations;
diff -Nurb elks.orig/include/linuxmt/init.h elks/include/linuxmt/init.h
--- elks.orig/include/linuxmt/init.h    2002-06-04 12:25:17.000000000 -0500
+++ elks/include/linuxmt/init.h 2011-12-13 18:54:00.000000000 -0600
@@ -5,6 +5,9 @@

 #include <linuxmt/types.h>

+struct task_struct;
+struct gendisk;
+
 extern int directhd_init(void);
 extern int rs_init(void);

diff -Nurb elks.orig/include/linuxmt/locks.h elks/include/linuxmt/locks.h
--- elks.orig/include/linuxmt/locks.h   2002-04-26 18:05:27.000000000 -0500
+++ elks/include/linuxmt/locks.h        2011-12-13 10:21:13.000000000 -0600
@@ -7,6 +7,6 @@

 extern void wait_on_super(register struct super_block *);
 extern void lock_super(register struct super_block *);
-extern void unlock_super(register struct super_blocak *);
+extern void unlock_super(register struct super_block *);

 #endif
diff -Nurb elks.orig/include/linuxmt/timer.h elks/include/linuxmt/timer.h
--- elks.orig/include/linuxmt/timer.h   2002-04-26 18:05:27.000000000 -0500
+++ elks/include/linuxmt/timer.h        2011-12-13 18:30:31.000000000 -0600
@@ -84,6 +84,7 @@
     void (*tl_function) ();
 };

+struct pt_regs;
 extern void init_timer(struct timer_list *);
 extern void add_timer(struct timer_list *);
 extern int del_timer(struct timer_list *);
diff -Nurb elks.orig/kernel/sched.c elks/kernel/sched.c
--- elks.orig/kernel/sched.c    2003-01-02 16:45:44.000000000 -0600
+++ elks/kernel/sched.c 2011-12-13 18:34:31.000000000 -0600
@@ -172,7 +172,7 @@
            lastirq, currentp->pid, prev->pid);
 }

-struct timer_list tl_list = { NULL, NULL, NULL, NULL, NULL };
+struct timer_list tl_list = { NULL, NULL, 0L, 0, NULL };

 static int detach_timer(struct timer_list *timer)
 {
diff -Nurb elks.orig/kernel/sys.c elks/kernel/sys.c
--- elks.orig/kernel/sys.c	2002-07-16 12:51:06.000000000 -0500
+++ elks/kernel/sys.c	2012-01-17 18:58:09.000000000 -0600
@@ -95,7 +95,7 @@
 {
     register char *p = system_utsname.release;

-    verified_memcpy_tofs(vsn, p, strlen(p) + 1);
+    return verified_memcpy_tofs(vsn, p, strlen(p) + 1);
 }

 #endif
diff -Nurb elks.orig/include/arch/keyboard.h elks/include/arch/keyboard.h
--- elks.orig/include/arch/keyboard.h	2002-06-04 12:25:16.000000000 -0500
+++ elks/include/arch/keyboard.h	2012-01-21 11:16:23.000000000 -0600
@@ -1,6 +1,7 @@
 #ifndef LX86_ARCH_KEYBOARD_H
 #define LX86_ARCH_KEYBOARD_H

+struct pt_regs;
 extern void keyboard_irq(int,struct pt_regs *,void *);
 extern void Console_set_vc(unsigned);

diff -Nurb elks.orig/include/arch/segment.h elks/include/arch/segment.h
--- elks.orig/include/arch/segment.h	2002-05-30 12:26:11.000000000 -0500
+++ elks/include/arch/segment.h	2012-01-20 16:27:06.000000000 -0600
@@ -20,7 +20,7 @@

 #endif

-extern __u16 setupw(unsigned short int, unsigned short int *);
+extern __u16 setupw(/*unsigned short int, */unsigned short int *);

 extern pid_t get_pid(void);

diff -Nurb elks.orig/include/linuxmt/minix_fs.h elks/include/linuxmt/minix_fs.h
--- elks.orig/include/linuxmt/minix_fs.h	2002-05-29 17:30:05.000000000 -0500
+++ elks/include/linuxmt/minix_fs.h	2012-01-20 15:55:21.000000000 -0600
@@ -89,7 +89,7 @@
 extern struct inode *minix_new_inode(struct inode *);
 extern void minix_put_inode(register struct inode *);
 extern void minix_put_super(register struct super_block *);
-extern void minix_read_inode(register struct inode *);
+/*extern void minix_read_inode(register struct inode *);*/
 extern struct super_block *minix_read_super(register struct super_block *,
 					    char *,int);
 extern int minix_remount(register struct super_block *,int *,char *);

                 reply	other threads:[~2012-05-08  6:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD6VGubJxJzULWYTw9amFUYo5TG5fJ7-eP-0PAP=-04R8t0tsQ@mail.gmail.com' \
    --to=lithoxs@gmail.com \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).