[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[VCDImager Bugs/Devel] vcdimager for BSD/OS
From: |
Steven M. Schultz |
Subject: |
[VCDImager Bugs/Devel] vcdimager for BSD/OS |
Date: |
Sat, 12 May 2001 23:15:59 -0700 (PDT) |
Greetings --
vcdimager-0.6.2rc3 now works, with the patch below, on BSD/OS using
the "libdvd" (a userland library that emulates the linux DVD and VCD
ioctls).
For the most part the changes (which were surprisingly small and few)
consisted of changing "#ifdef __linux__" to be "#if defined(__linux__)
|| defined(__bsdi__)". A couple portability changes (integer type
declarations, etc) were added with "#ifdef __bsdi__ ... #endif"
statements and the magic "#include <dvd.h>" added in one or two places.
The only thing I did not know how to do properly was add in the
reference to "-ldvd". I manually editing the one Makefile.am and
added -ldvd but that's certainly wrong.
If you've any questions feel free to write back.
I've tested this (and spent the eve riping VCDs ;)) with BSD/OS 4.2
but it should run on any BSD/OS release with the 'generic scsi'
capability. Also tested were both ATAPI and SCSI drives (BSDI
has a real nice SCSI over ATAPI layer) and everything "just worked".
Cheers.
Steven Schultz
address@hidden
-------------------------cut here--------------------------------
--- ./libvcd/vcd_bytesex.h.dist Sat Jan 6 09:09:53 2001
+++ ./libvcd/vcd_bytesex.h Sat May 12 17:31:52 2001
@@ -30,10 +30,15 @@
(((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \
(((uint32_t) (val) & (uint32_t) 0x0000ff00U) << 8) | \
(((uint32_t) (val) & (uint32_t) 0x00ff0000U) >> 8) | \
(((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24)))
+#ifdef __bsdi__
+# define UINT32_C(c) c ## U
+# define UINT64_C(c) c ## ULL
+#endif
+
#define UINT64_SWAP_LE_BE(val) ((uint64_t) ( \
(((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000000000ff)) << 56) | \
(((uint64_t) (val) & (uint64_t) UINT64_C(0x000000000000ff00)) << 40) | \
(((uint64_t) (val) & (uint64_t) UINT64_C(0x0000000000ff0000)) << 24) | \
(((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000ff000000)) << 8) | \
--- ./libvcd/vcd.c.dist Sun May 6 09:12:15 2001
+++ ./libvcd/vcd.c Sat May 12 17:33:31 2001
@@ -30,10 +30,11 @@
#include <math.h>
#include "vcd.h"
#include "vcd_obj.h"
+#include "vcd_bytesex.h"
#include "vcd_types.h"
#include "vcd_iso9660.h"
#include "vcd_salloc.h"
#include "vcd_files.h"
#include "vcd_files_private.h"
--- ./frontends/cli/vcdrip.c.dist Fri May 4 12:30:59 2001
+++ ./frontends/cli/vcdrip.c Sat May 12 21:44:46 2001
@@ -33,10 +33,14 @@
#ifdef __linux__
#warning expect missing prototype warnings from swab.h
#include <linux/cdrom.h>
#endif
+#ifdef __bsdi__
+#include <dvd.h>
+#endif
+
#include "vcd_types.h"
#include "vcd_bytesex.h"
#include "vcd_cd_sector.h"
#include "vcd_files.h"
#include "vcd_files_private.h"
@@ -185,11 +189,11 @@
#endif
static int
_read_mode2_sector_device (FILE *fd, void *data, uint32_t lba, bool form2)
{
-#ifdef __linux__
+#if defined(__linux__) || defined(__bsdi__)
assert (fd != NULL);
if (form2)
{
char buf[M2RAW_SIZE] = { 0, };
@@ -202,11 +206,11 @@
msf->cdmsf_frame0 = from_bcd8(_msf.f);
/* if (!msf->cdmsf_frame0) */
fprintf (stdout, "reading %2.2d:%2.2d:%2.2d \r",
msf->cdmsf_min0, msf->cdmsf_sec0, msf->cdmsf_frame0);
-
+ fflush(stdout);
if (ioctl (fileno (fd), CDROMREADMODE2, &buf) == -1)
{
perror ("ioctl()");
return 1;
/* exit (EXIT_FAILURE); */
@@ -241,11 +245,11 @@
}
static uint32_t
_get_image_size_device (FILE *fd)
{
-#ifdef __linux__
+#if defined(__linux__) || defined(__bsdi__)
struct cdrom_tocentry tocent;
uint32_t size;
tocent.cdte_track = CDROM_LEADOUT;
tocent.cdte_format = CDROM_LBA;
@@ -1245,13 +1249,13 @@
"set image file as source", "FILE"},
{"sector-2336", '\0', POPT_ARG_NONE, &gl_sector_2336_flag, 0,
"use 2336 byte sector mode for image file"},
-#ifdef __linux__
+#if defined(__linux__) || defined(__bsdi__)
{"cdrom-device", '\0', POPT_ARG_STRING, &gl_source_name, SOURCE_DEVICE,
- "set CDROM device as source (linux only)", "DEVICE"},
+ "set CDROM device as source (linux and bsdi only)", "DEVICE"},
#endif
{"dump", 'd', POPT_ARG_NONE, NULL, OP_DUMP,
"dump information about VideoCD"},
--- ./frontends/cli/Makefile.am.dist Sat Mar 17 08:19:19 2001
+++ ./frontends/cli/Makefile.am Sat May 12 17:34:23 2001
@@ -10,11 +10,11 @@
SUBDIRS = $(POPT_SUBDIR)
INCLUDES = $(POPT_INCLUDES) -I $(top_srcdir)/libvcd/
-VCD_LIBS = $(top_builddir)/libvcd/libvcd.a
+VCD_LIBS = $(top_builddir)/libvcd/libvcd.a -ldvd
vcdimager_SOURCES = vcdimager.c
vcdimager_LDADD = $(VCD_LIBS) $(POPT_LIBS)
vcdrip_SOURCES = vcdrip.c
- [VCDImager Bugs/Devel] vcdimager for BSD/OS,
Steven M. Schultz <=