[syslinux:disklib] libcom32: Introduce disk header and module

syslinux-bot for Shao Miller shao.miller at yrdsb.edu.on.ca
Sun Jul 25 17:33:07 PDT 2010


Commit-ID:  e2bba11e4aabeada9e4b8bb184ffadbdf14add3c
Gitweb:     http://syslinux.zytor.com/commit/e2bba11e4aabeada9e4b8bb184ffadbdf14add3c
Author:     Shao Miller <shao.miller at yrdsb.edu.on.ca>
AuthorDate: Mon, 28 Jun 2010 00:31:08 -0400
Committer:  Shao Miller <shao.miller at yrdsb.edu.on.ca>
CommitDate: Sat, 10 Jul 2010 01:00:47 -0400

libcom32: Introduce disk header and module

An effort to move significant portions out of chain.c32 and
into library is underway.  We begin by simply moving
SECTOR into a header and building a disk module.

Note that some of this work will essentially duplicate
some of what's found in Pierre-Alexandre Meyer's fine
work in com32/gpllib/disk/.  A difference would be the
licensing, of course.

Signed-off-by: Shao Miller <shao.miller at yrdsb.edu.on.ca>


---
 com32/include/syslinux/{io.h => disk.h} |   18 ++++++++++--------
 com32/lib/Makefile                      |    4 +++-
 com32/lib/{exit.c => syslinux/disk.c}   |   19 +++++++------------
 com32/modules/chain.c                   |    3 +--
 4 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/com32/include/syslinux/io.h b/com32/include/syslinux/disk.h
similarity index 78%
copy from com32/include/syslinux/io.h
copy to com32/include/syslinux/disk.h
index 329377d..482dece 100644
--- a/com32/include/syslinux/io.h
+++ b/com32/include/syslinux/disk.h
@@ -1,6 +1,8 @@
 /* ----------------------------------------------------------------------- *
  *
- *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ *   Copyright (C) 2010 Shao Miller
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -25,15 +27,15 @@
  *
  * ----------------------------------------------------------------------- */
 
-/*
- * syslinux/io.h
+/**
+ * @file syslinux/disk.h
  *
- * SYSLINUX low-level I/O functions
+ * Deal with disks and partitions
  */
 
-#ifndef _SYSLINUX_IO_H
-#define _SYSLINUX_IO_H
+#ifndef _SYSLINUX_DISK_H
+#define _SYSLINUX_DISK_H
 
-int syslinux_read_disk(void *buf, uint32_t sector, uint16_t count);
+#define SECTOR 512		/* bytes/sector */
 
-#endif /* _SYSLINUX_IO_H */
+#endif /* _SYSLINUX_DISK_H */
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 2035df2..ed4bb31 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -119,7 +119,9 @@ LIBOBJS = \
 	syslinux/setadv.o						\
 	\
 	syslinux/video/fontquery.o syslinux/video/forcetext.o		\
-	syslinux/video/reportmode.o
+	syslinux/video/reportmode.o					\
+	\
+	syslinux/disk.o
 
 # These are the objects which are also imported into the core
 LIBCOREOBJS = 	\
diff --git a/com32/lib/exit.c b/com32/lib/syslinux/disk.c
similarity index 83%
copy from com32/lib/exit.c
copy to com32/lib/syslinux/disk.c
index ccd6f1e..2a286e4 100644
--- a/com32/lib/exit.c
+++ b/com32/lib/syslinux/disk.c
@@ -1,6 +1,8 @@
 /* ----------------------------------------------------------------------- *
  *
- *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ *   Copyright (C) 2010 Shao Miller
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -25,17 +27,10 @@
  *
  * ----------------------------------------------------------------------- */
 
-/*
- * exit.c
+/**
+ * @file disk.c
  *
- * The regular exit
+ * Deal with disks and partitions
  */
 
-#include <stdlib.h>
-
-extern __noreturn(*__exit_handler) (int);
-
-__noreturn exit(int rv)
-{
-    __exit_handler(rv);
-}
+#include <syslinux/disk.h>
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 48a83d2..d6005e2 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -117,10 +117,9 @@
 #include <syslinux/loadfile.h>
 #include <syslinux/bootrm.h>
 #include <syslinux/config.h>
+#include <syslinux/disk.h>
 #include <syslinux/video.h>
 
-#define SECTOR 512		/* bytes/sector */
-
 static struct options {
     const char *loadfile;
     uint16_t keeppxe;



More information about the Syslinux-commits mailing list