OpenBIOS
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1998 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1997 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1996 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1995 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1994 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1993 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1992 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1991 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1990 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1989 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1988 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1987 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1986 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1985 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1984 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1983 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1982 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1981 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1980 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1979 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1978 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1977 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1976 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1975 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1974 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1973 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1972 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1971 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1970 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1969 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1968 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1967 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1966 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1965 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1964 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1963 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1962 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1961 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1960 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1959 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1958 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1957 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1956 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1955 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1954 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1953 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1952 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1951 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1950 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1949 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1948 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1947 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1946 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1945 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1944 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1943 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1942 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1941 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1940 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1939 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1938 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1937 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1936 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1935 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1934 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1933 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1932 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1931 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1930 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1929 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1928 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1927 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1926 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1925 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1924 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1923 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1922 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1921 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1920 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1919 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1918 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1917 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1916 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1915 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1914 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1913 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1912 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1911 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1910 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1909 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1908 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1907 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1906 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1905 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1904 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
July 2010
- 7 participants
- 25 discussions
Author: mcayland
Date: Sun Jul 4 01:22:21 2010
New Revision: 811
URL: http://tracker.coreboot.org/trac/openbios/changeset/811
Log:
Fix a couple of incorrect error codes in hfsp_files_open(), and also revert the filesystem type return value to a cstr to
maintain the existing API.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/fs/hfsplus/hfsp_fs.c
Modified: trunk/openbios-devel/fs/hfsplus/hfsp_fs.c
==============================================================================
--- trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sat Jul 3 21:02:43 2010 (r810)
+++ trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sun Jul 4 01:22:21 2010 (r811)
@@ -216,7 +216,7 @@
if (volume_open(mi->vol, fd)) {
free( path );
close_io( fd );
- RET( -1 );
+ RET( 0 );
}
mi->hfspfile = malloc( sizeof(hfsp_file_t) );
@@ -244,7 +244,7 @@
if( !search_files(&(mi->hfspfile->rec), 0, match_path, path, mi->hfspfile ) )
RET ( -1 );
- RET ( 0 );
+ RET ( -1 );
}
/* ( -- ) */
@@ -383,11 +383,11 @@
RET ( act_count );
}
-/* ( -- str len ) */
+/* ( -- cstr ) */
static void
hfsp_files_get_fstype( hfsp_info_t *mi )
{
- push_str("HFS+");
+ PUSH( (ucell)strdup("HFS+") );
}
/* ( -- cstr ) */
1
0
July 3, 2010
Author: mcayland
Date: Sat Jul 3 21:02:43 2010
New Revision: 810
URL: http://tracker.coreboot.org/trac/openbios/changeset/810
Log:
Move the HFS+ filesystem handler into its own new package /packages/hfsplus-files.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/fs/hfsplus/hfsp_fs.c
trunk/openbios-devel/packages/init.c
trunk/openbios-devel/packages/misc-files.c
trunk/openbios-devel/packages/packages.h
Modified: trunk/openbios-devel/fs/hfsplus/hfsp_fs.c
==============================================================================
--- trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sat Jul 3 16:39:49 2010 (r809)
+++ trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sat Jul 3 21:02:43 2010 (r810)
@@ -2,11 +2,12 @@
* Creation Date: <2001/05/05 23:33:49 samuel>
* Time-stamp: <2004/01/12 10:25:39 samuel>
*
- * <hfsp_fs.c>
+ * /package/hfsplus-files
*
* HFS+ file system interface (and ROM lookup support)
*
* Copyright (C) 2001, 2002, 2003, 2004 Samuel Rydh (samuel(a)ibrium.se)
+ * Copyright (C) 2010 Mark Cave-Ayland (mark.cave-ayland(a)siriusit.co.uk)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -15,13 +16,14 @@
*/
#include "config.h"
+#include "libopenbios/bindings.h"
#include "fs/fs.h"
#include "libhfsp.h"
#include "volume.h"
#include "record.h"
#include "unicode.h"
#include "blockiter.h"
-
+#include "libc/diskio.h"
#define MAC_OS_ROM_CREATOR 0x63687270 /* 'chrp' */
#define MAC_OS_ROM_TYPE 0x74627869 /* 'tbxi' */
@@ -32,14 +34,23 @@
#define SYSTEM_TYPE 0x7A737973 /* 'zsys' */
#define SYSTEM_CREATOR 0x4D414353 /* 'MACS' */
+#define VOLNAME_SIZE 64
+
+extern void hfsp_init( void );
typedef struct {
record rec;
char *path;
-
off_t pos;
} hfsp_file_t;
+typedef struct {
+ volume *vol;
+ hfsp_file_t *hfspfile;
+} hfsp_info_t;
+
+DECLARE_NODE( hfsp, 0, sizeof(hfsp_info_t), "+/packages/hfsplus-files" );
+
/************************************************************************/
/* Search implementation */
@@ -88,9 +99,8 @@
}
static int
-root_search_files( fs_ops_t *fs, int recursive, match_proc_t proc, const void *match_data, hfsp_file_t *pt )
+root_search_files( volume *vol, int recursive, match_proc_t proc, const void *match_data, hfsp_file_t *pt )
{
- volume *vol = (volume*)fs->fs_data;
record r;
record_init_root( &r, &vol->catalog );
@@ -183,34 +193,34 @@
/************************************************************************/
-/* File System Operations */
+/* Standard package methods */
/************************************************************************/
+/* ( -- success? ) */
static void
-close_fs( fs_ops_t *fs )
+hfsp_files_open( hfsp_info_t *mi )
{
- volume *vol = (volume*)fs->fs_data;
- volume_close( vol );
- free( vol );
-}
+ int fd;
+ char *path = my_args_copy();
-static file_desc_t *
-_create_fops( hfsp_file_t *t )
-{
- hfsp_file_t *r = malloc( sizeof(hfsp_file_t) );
+ if ( ! path )
+ RET( 0 );
- *r = *t;
- r->pos = 0;
- return (file_desc_t*)r;
-}
+ fd = open_ih( my_parent() );
+ if ( fd == -1 ) {
+ free( path );
+ RET( 0 );
+ }
-static file_desc_t *
-open_path( fs_ops_t *fs, const char *path )
-{
- hfsp_file_t t;
- volume *vol = (volume*)fs->fs_data;
- record r;
+ mi->vol = malloc( sizeof(volume) );
+ if (volume_open(mi->vol, fd)) {
+ free( path );
+ close_io( fd );
+ RET( -1 );
+ }
+ mi->hfspfile = malloc( sizeof(hfsp_file_t) );
+
/* Leading \\ means system folder. The finder info block has
* the following meaning.
*
@@ -219,80 +229,104 @@
* [5] MacOS X boot directory ID
*/
if( !strncmp(path, "\\\\", 2) ) {
- int *p = (int*)&vol->vol.finder_info[0];
+ int *p = (int*)&(mi->vol)->vol.finder_info[0];
int cnid = p[0];
/* printk(" p[0] = %x, p[3] = %x, p[5] = %x\n", p[0], p[3], p[5] ); */
if( p[0] == p[5] && p[3] )
cnid = p[3];
- if( record_init_cnid(&r, &vol->catalog, cnid) )
- return NULL;
+ if( record_init_cnid(&(mi->hfspfile->rec), &(mi->vol)->catalog, cnid) )
+ RET ( 0 );
path += 2;
} else {
- record_init_root( &r, &vol->catalog );
+ record_init_root( &(mi->hfspfile->rec), &(mi->vol)->catalog );
}
- if( !search_files(&r, 0, match_path, path, &t) )
- return _create_fops( &t );
- return NULL;
+ if( !search_files(&(mi->hfspfile->rec), 0, match_path, path, mi->hfspfile ) )
+ RET ( -1 );
+
+ RET ( 0 );
}
-static file_desc_t *
-search_rom( fs_ops_t *fs )
+/* ( -- ) */
+static void
+hfsp_files_close( hfsp_info_t *mi )
{
- hfsp_file_t t;
+ volume_close(mi->vol);
- if( !root_search_files(fs, 1, match_rom, NULL, &t) )
- return _create_fops( &t );
- return NULL;
+ if( mi->hfspfile->path )
+ free( mi->hfspfile->path );
+ free( mi->hfspfile );
}
-static file_desc_t *
-search_file( fs_ops_t *fs, const char *name )
+/* ( buf len -- actlen ) */
+static void
+hfsp_files_read( hfsp_info_t *mi )
{
- hfsp_file_t t;
+ int count = POP();
+ char *buf = (char *)POP();
- if( !root_search_files(fs, 1, match_file, name, &t) )
- return _create_fops( &t );
- return NULL;
-}
+ hfsp_file_t *t = mi->hfspfile;
+ volume *vol = t->rec.tree->vol;
+ UInt32 blksize = vol->blksize;
+ hfsp_cat_file *file = &t->rec.record.u.file;
+ blockiter iter;
+ char buf2[blksize];
+ int act_count, curpos=0;
+
+ blockiter_init( &iter, vol, &file->data_fork, HFSP_EXTENT_DATA, file->id );
+ while( curpos + blksize < t->pos ) {
+ if( blockiter_next( &iter ) ) {
+ RET ( -1 );
+ return;
+ }
+ curpos += blksize;
+ }
+ act_count = 0;
+ while( act_count < count ){
+ UInt32 block = blockiter_curr(&iter);
+ int max = blksize, add = 0, size;
-/************************************************************************/
-/* File Operations */
-/************************************************************************/
+ if( volume_readinbuf( vol, buf2, block ) )
+ break;
-static char *
-get_path( file_desc_t *fd, char *buf, int len )
-{
- hfsp_file_t *t = (hfsp_file_t*)fd;
- if( !t->path )
- return NULL;
+ if( curpos < t->pos ){
+ add += t->pos - curpos;
+ max -= t->pos - curpos;
+ }
+ size = (count-act_count > max)? max : count-act_count;
+ memcpy( (char *)buf + act_count, &buf2[add], size );
+
+ curpos += blksize;
+ act_count += size;
+
+ if( blockiter_next( &iter ) )
+ break;
+ }
- strncpy( buf, t->path, len );
- buf[len-1] = 0;
- return buf;
+ t->pos += act_count;
+
+ RET ( act_count );
}
+/* ( pos.d -- status ) */
static void
-file_close( file_desc_t *fd )
+hfsp_files_seek( hfsp_info_t *mi )
{
- hfsp_file_t *t = (hfsp_file_t*)fd;
- if( t->path )
- free( t->path );
- free( t );
-}
+ llong pos = DPOP();
+ int offs = (int)pos;
+ int whence = SEEK_SET;
-static int
-file_lseek( file_desc_t *fd, off_t offs, int whence )
-{
- hfsp_file_t *t = (hfsp_file_t*)fd;
+ hfsp_file_t *t = mi->hfspfile;
hfsp_cat_file *file = &t->rec.record.u.file;
int total = file->data_fork.total_size;
+ if( offs == -1 ) {
+ offs = 0;
+ whence = SEEK_END;
+ }
+
switch( whence ){
- case SEEK_CUR:
- t->pos += offs;
- break;
case SEEK_END:
t->pos = total + offs;
break;
@@ -308,101 +342,139 @@
if( t->pos > total )
t->pos = total;
- return t->pos;
+ RET ( 0 );
}
-static int
-file_read( file_desc_t *fd, void *buf, size_t count )
+/* ( addr -- size ) */
+static void
+hfsp_files_load( hfsp_info_t *mi )
{
- hfsp_file_t *t = (hfsp_file_t*)fd;
+ char *buf = (char *)POP();
+
+ hfsp_file_t *t = mi->hfspfile;
volume *vol = t->rec.tree->vol;
UInt32 blksize = vol->blksize;
hfsp_cat_file *file = &t->rec.record.u.file;
+ int total = file->data_fork.total_size;
blockiter iter;
char buf2[blksize];
- int act_count, curpos=0;
+ int act_count;
blockiter_init( &iter, vol, &file->data_fork, HFSP_EXTENT_DATA, file->id );
- while( curpos + blksize < t->pos ) {
- if( blockiter_next( &iter ) )
- return -1;
- curpos += blksize;
- }
+
act_count = 0;
- while( act_count < count ){
+ while( act_count < total ){
UInt32 block = blockiter_curr(&iter);
- int max = blksize, add = 0, size;
+ int max = blksize, size;
if( volume_readinbuf( vol, buf2, block ) )
break;
- if( curpos < t->pos ){
- add += t->pos - curpos;
- max -= t->pos - curpos;
- }
- size = (count-act_count > max)? max : count-act_count;
- memcpy( (char *)buf + act_count, &buf2[add], size );
+ size = (total-act_count > max)? max : total-act_count;
+ memcpy( (char *)buf + act_count, &buf2, size );
- curpos += blksize;
act_count += size;
if( blockiter_next( &iter ) )
break;
}
- t->pos += act_count;
- return (act_count > 0)? act_count : -1;
+ RET ( act_count );
}
-static char *
-vol_name( fs_ops_t *fs, char *buf, int size )
+/* ( -- str len ) */
+static void
+hfsp_files_get_fstype( hfsp_info_t *mi )
{
- return get_hfs_vol_name( fs->fd, buf, size );
+ push_str("HFS+");
}
-static const char *
-get_fstype( fs_ops_t *fs )
+/* ( -- cstr ) */
+static void
+hfsp_files_get_path( hfsp_info_t *mi )
{
- return ("HFS+");
-}
+ char *buf;
+ hfsp_file_t *t = mi->hfspfile;
+ if( !t->path )
+ RET ( 0 );
-static const fs_ops_t fs_ops = {
- .close_fs = close_fs,
- .open_path = open_path,
- .search_rom = search_rom,
- .search_file = search_file,
- .vol_name = vol_name,
+ buf = malloc(strlen(t->path) + 1);
+ strncpy( buf, t->path, strlen(t->path) );
+ buf[strlen(t->path)] = 0;
- .get_path = get_path,
- .close = file_close,
- .read = file_read,
- .lseek = file_lseek,
+ PUSH ((ucell)buf);
+}
- .get_fstype = get_fstype
-};
+/* ( -- success? ) */
+static void
+hfsp_files_open_nwrom( hfsp_info_t *mi )
+{
+ /* Switch to an existing ROM image file on the fs! */
+ if( !root_search_files(mi->vol, 1, match_rom, NULL, mi->hfspfile) )
+ RET ( -1 );
+
+ RET ( 0 );
+}
-int
-fs_hfsp_open( int os_fd, fs_ops_t *fs )
+/* ( -- cstr|0 ) */
+static void
+hfsp_files_volume_name( hfsp_info_t *mi )
{
- volume *vol = malloc( sizeof(volume) );
+ int fd;
+ char *volname = malloc(VOLNAME_SIZE);
- if( volume_open(vol, os_fd) ) {
- free( vol );
- return -1;
- }
- *fs = fs_ops;
- fs->fs_data = vol;
+ fd = open_ih(my_self());
+ get_hfs_vol_name(fd, volname, VOLNAME_SIZE);
+ close_io(fd);
- return 0;
+ PUSH ((ucell)volname);
}
-int
-fs_hfsp_probe(int fd, llong offs)
+/* static method, ( pos.d ih -- flag? ) */
+static void
+hfsp_files_probe( hfsp_info_t *dummy )
{
+ ihandle_t ih = POP_ih();
+ llong offs = DPOP();
+ int fd, ret = 0;
+
+ fd = open_ih(ih);
if (volume_probe(fd, offs))
- return 0;
+ ret = -1;
+
+ close_io(fd);
+
+ RET (ret);
+}
- return -1;
+
+static void
+hfsp_initializer( hfsp_info_t *dummy )
+{
+ fword("register-fs-package");
+}
+
+NODE_METHODS( hfsp ) = {
+ { "probe", hfsp_files_probe },
+ { "open", hfsp_files_open },
+ { "close", hfsp_files_close },
+ { "read", hfsp_files_read },
+ { "seek", hfsp_files_seek },
+ { "load", hfsp_files_load },
+
+ /* special */
+ { "open-nwrom", hfsp_files_open_nwrom },
+ { "get-path", hfsp_files_get_path },
+ { "get-fstype", hfsp_files_get_fstype },
+ { "volume-name", hfsp_files_volume_name },
+
+ { NULL, hfsp_initializer },
+};
+
+void
+hfsp_init( void )
+{
+ REGISTER_NODE( hfsp );
}
Modified: trunk/openbios-devel/packages/init.c
==============================================================================
--- trunk/openbios-devel/packages/init.c Sat Jul 3 16:39:49 2010 (r809)
+++ trunk/openbios-devel/packages/init.c Sat Jul 3 21:02:43 2010 (r810)
@@ -30,6 +30,9 @@
#ifdef CONFIG_DISK_LABEL
disklabel_init();
#endif
+#ifdef CONFIG_HFSP
+ hfsp_init();
+#endif
#ifdef CONFIG_ISO9660
iso9660_init();
#endif
Modified: trunk/openbios-devel/packages/misc-files.c
==============================================================================
--- trunk/openbios-devel/packages/misc-files.c Sat Jul 3 16:39:49 2010 (r809)
+++ trunk/openbios-devel/packages/misc-files.c Sat Jul 3 21:02:43 2010 (r810)
@@ -57,14 +57,8 @@
err = (fd = open_ih(ih)) == -1;
if( !err ) {
- err = fs_hfsp_open(fd, fs);
- DPRINTF("--- HFSP returned %d\n", err);
-
- if( err ) {
- err = fs_hfs_open(fd, fs);
- DPRINTF("--- HFS returned %d\n", err);
- }
-
+ err = fs_hfs_open(fd, fs);
+
if( err ) {
err = fs_ext2_open(fd, fs);
DPRINTF("--- ext2 returned %d\n", err);
@@ -347,13 +341,8 @@
err = (fd = open_ih(ih)) == -1;
if( !err ) {
- err = fs_hfsp_probe(fd, offs);
- DPRINTF("--- HFSP returned %d\n", err);
-
- if( err ) {
- err = fs_hfs_probe(fd, offs);
- DPRINTF("--- HFS returned %d\n", err);
- }
+ err = fs_hfs_probe(fd, offs);
+ DPRINTF("--- HFS returned %d\n", err);
if( err ) {
err = fs_ext2_probe(fd, offs);
Modified: trunk/openbios-devel/packages/packages.h
==============================================================================
--- trunk/openbios-devel/packages/packages.h Sat Jul 3 16:39:49 2010 (r809)
+++ trunk/openbios-devel/packages/packages.h Sat Jul 3 21:02:43 2010 (r810)
@@ -21,6 +21,7 @@
extern void disklabel_init( void );
extern void files_init( void );
extern void iso9660_init( void );
+extern void hfsp_init( void );
extern void macparts_init( void );
extern void pcparts_init( void );
extern void sunparts_init( void );
1
0
[commit] r809 - in trunk/openbios-devel: config/examples fs/iso9660 packages
by repository service July 3, 2010
by repository service July 3, 2010
July 3, 2010
Author: mcayland
Date: Sat Jul 3 16:39:49 2010
New Revision: 809
URL: http://tracker.coreboot.org/trac/openbios/changeset/809
Log:
Move the separate ISO9660 handler into a new /packages/iso9660-files package in preparation for some future work. Based heavily
on Laurent's original patch posted to the list.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/config/examples/cross-sparc32_config.xml
trunk/openbios-devel/config/examples/cross-sparc64_config.xml
trunk/openbios-devel/fs/iso9660/iso9660_fs.c
trunk/openbios-devel/packages/disk-label.c
trunk/openbios-devel/packages/init.c
trunk/openbios-devel/packages/mac-parts.c
trunk/openbios-devel/packages/misc-files.c
trunk/openbios-devel/packages/packages.h
trunk/openbios-devel/packages/pc-parts.c
trunk/openbios-devel/packages/sun-parts.c
Modified: trunk/openbios-devel/config/examples/cross-sparc32_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/cross-sparc32_config.xml Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/config/examples/cross-sparc32_config.xml Sat Jul 3 16:39:49 2010 (r809)
@@ -56,6 +56,7 @@
<option name="CONFIG_FS" type="boolean" value="true"/>
<option name="CONFIG_HFS" type="boolean" value="false"/>
<option name="CONFIG_HFSP" type="boolean" value="false"/>
+ <option name="CONFIG_ISO9660" type="boolean" value="false"/>
<option name="CONFIG_GRUBFS" type="boolean" value="true"/>
<option name="CONFIG_FSYS_EXT2FS" type="boolean" value="true"/>
<option name="CONFIG_FSYS_FAT" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/cross-sparc64_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/cross-sparc64_config.xml Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/config/examples/cross-sparc64_config.xml Sat Jul 3 16:39:49 2010 (r809)
@@ -56,6 +56,7 @@
<option name="CONFIG_FS" type="boolean" value="true"/>
<option name="CONFIG_HFS" type="boolean" value="false"/>
<option name="CONFIG_HFSP" type="boolean" value="false"/>
+ <option name="CONFIG_ISO9660" type="boolean" value="false"/>
<option name="CONFIG_GRUBFS" type="boolean" value="true"/>
<option name="CONFIG_FSYS_EXT2FS" type="boolean" value="true"/>
<option name="CONFIG_FSYS_FAT" type="boolean" value="false"/>
Modified: trunk/openbios-devel/fs/iso9660/iso9660_fs.c
==============================================================================
--- trunk/openbios-devel/fs/iso9660/iso9660_fs.c Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/fs/iso9660/iso9660_fs.c Sat Jul 3 16:39:49 2010 (r809)
@@ -1,12 +1,18 @@
/*
+ * /packages/iso9660-files filesystem handler
*
* (c) 2009 Laurent Vivier <Laurent(a)vivier.eu>
- *
+ * (c) 2010 Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
*/
+#include "config.h"
+#include "libopenbios/bindings.h"
#include "libiso9660.h"
#include "fs/fs.h"
#include "libc/vsprintf.h"
+#include "libc/diskio.h"
+
+extern void iso9660_init( void );
typedef struct {
enum { FILE, DIR } type;
@@ -16,34 +22,159 @@
};
} iso9660_COMMON;
+typedef struct {
+ iso9660_VOLUME *volume;
+ iso9660_COMMON *common;
+} iso9660_info_t;
+
+DECLARE_NODE( iso9660, 0, sizeof(iso9660_info_t), "+/packages/iso9660-files" );
+
+/* ( -- success? ) */
+static void
+iso9660_files_open( iso9660_info_t *mi )
+{
+ int fd;
+ char *path = my_args_copy();
+
+ if ( ! path )
+ RET( 0 );
+
+ fd = open_ih( my_parent() );
+ if ( fd == -1 ) {
+ free( path );
+ RET( 0 );
+ }
+
+ mi->volume = iso9660_mount( fd );
+ if ( mi->volume == NULL ) {
+ free( path );
+ close_io( fd );
+ RET( -1 );
+ }
+
+ mi->common->dir = iso9660_opendir( mi->volume, path );
+ if ( mi->common->dir == NULL ) {
+ mi->common->file = iso9660_open( mi->volume, path );
+ if (mi->common->file == NULL) {
+ iso9660_umount( mi->volume );
+ close_io( fd );
+ free( path );
+ RET( -1 );
+ }
+ mi->common->type = FILE;
+ free( path );
+ RET( 0 );
+ }
+ mi->common->type = DIR;
+ free( path );
+
+ RET( -1 );
+}
+
+/* ( -- ) */
+static void
+iso9660_files_close( iso9660_info_t *mi )
+{
+ int fd = mi->volume->fd;
+
+ if (mi->common->type == FILE )
+ iso9660_close( mi->common->file );
+ else if ( mi->common->type == DIR )
+ iso9660_closedir( mi->common->dir );
+ iso9660_umount( mi->volume );
+ close_io( fd );
+}
+
+/* ( buf len -- actlen ) */
+static void
+iso9660_files_read( iso9660_info_t *mi )
+{
+ int count = POP();
+ char *buf = (char *)POP();
+ int ret;
+
+ if ( mi->common->type != FILE )
+ PUSH( 0 );
+
+ ret = iso9660_read( mi->common->file, buf, count );
+
+ PUSH( ret );
+}
+
+/* ( pos.d -- status ) */
+static void
+iso9660_files_seek( iso9660_info_t *mi )
+{
+ llong pos = DPOP();
+ cell ret;
+ int offs = (int)pos;
+ int whence = SEEK_SET;
+
+ if (mi->common->type != FILE)
+ PUSH( -1 );
+
+ if( offs == -1 ) {
+ offs = 0;
+ whence = SEEK_END;
+ }
+
+ ret = iso9660_lseek(mi->common->file, offs, whence);
+
+ PUSH( (ret < 0)? -1 : 0 );
+}
+
+/* ( -- filepos.d ) */
static void
-umount( fs_ops_t *fs )
+iso9660_files_offset( iso9660_info_t *mi )
{
- iso9660_VOLUME *volume = (iso9660_VOLUME *)fs->fs_data;
+ if ( mi->common->type != FILE )
+ DPUSH( -1 );
+
+ DPUSH( mi->common->file->offset );
+}
- iso9660_umount( volume );
+/* ( addr -- size ) */
+static void
+iso9660_files_load( iso9660_info_t *mi)
+{
+ char *buf = (char*)POP();
+ int ret, size;
+
+ if ( mi->common->type != FILE )
+ PUSH( 0 );
+
+ size = 0;
+ while(1) {
+ ret = iso9660_read( mi->common->file, buf, 512 );
+ if (ret <= 0)
+ break;
+ buf += ret;
+ size += ret;
+ if (ret != 512)
+ break;
+ }
+ PUSH( size );
}
static void
-dir_fs ( file_desc_t *fd )
+iso9660_files_dir( iso9660_info_t *mi )
{
- iso9660_COMMON *common = (iso9660_COMMON *)fd;
struct iso_directory_record *idr;
char name_buf[256];
-
- if (common->type != DIR)
+
+ if (mi->common->type != DIR)
return;
forth_printf("\n");
- while ( (idr = iso9660_readdir(common->dir)) ) {
-
+ while ( (idr = iso9660_readdir(mi->common->dir)) ) {
+
forth_printf("% 10d ", isonum_733(idr->size));
forth_printf("%d-%02d-%02d %02d:%02d:%02d ",
idr->date[0] + 1900, /* year */
idr->date[1], /* month */
idr->date[2], /* day */
idr->date[3], idr->date[4], idr->date[5]);
- iso9660_name(common->dir->volume, idr, name_buf);
+ iso9660_name(mi->common->dir->volume, idr, name_buf);
if (idr->flags[0] & 2)
forth_printf("%s\\\n", name_buf);
else
@@ -51,126 +182,50 @@
}
}
-static file_desc_t *
-open_path( fs_ops_t *fs, const char *path )
-{
- iso9660_VOLUME *volume = (iso9660_VOLUME *)fs->fs_data;
- iso9660_COMMON *common;
-
- common = (iso9660_COMMON *)malloc(sizeof(*common));
- if (common == NULL)
- return NULL;
-
- common->dir = iso9660_opendir(volume, path);
- if (common->dir == NULL) {
- common->file = iso9660_open(volume, path);
- if (common->file == NULL) {
- free(common);
- return NULL;
- }
- common->type = FILE;
- return (file_desc_t *)common;
- }
- common->type = DIR;
- return (file_desc_t *)common;
-}
-
-static char *
-get_path( file_desc_t *fd, char *buf, int size )
-{
- iso9660_COMMON *common = (iso9660_COMMON *)fd;
-
- if (common->type != FILE)
- return NULL;
-
- strncpy(buf, common->file->path, size);
-
- return buf;
-}
-
-static int
-file_lseek( file_desc_t *fd, off_t offs, int whence )
-{
- iso9660_COMMON *common = (iso9660_COMMON *)fd;
-
- if (common->type != FILE)
- return -1;
-
- return iso9660_lseek(common->file, offs, whence);
-}
-
+/* static method, ( pos.d ih -- flag? ) */
static void
-file_close( file_desc_t *fd )
+iso9660_files_probe( iso9660_info_t *dummy )
{
- iso9660_COMMON *common = (iso9660_COMMON *)fd;
+ ihandle_t ih = POP_ih();
+ llong offs = DPOP();
+ int fd, ret = 0;
- if (common->type == FILE)
- iso9660_close(common->file);
- else if (common->type == DIR)
- iso9660_closedir(common->dir);
- free(common);
-}
-
-static int
-file_read( file_desc_t *fd, void *buf, size_t count )
-{
- iso9660_COMMON *common = (iso9660_COMMON *)fd;
+ fd = open_ih(ih);
+ if (iso9660_probe(fd, offs))
+ ret = -1;
- if (common->type != FILE)
- return -1;
+ close_io(fd);
- return iso9660_read(common->file, buf, count);
+ RET (ret);
}
-static char *
-vol_name( fs_ops_t *fs, char *buf, int size )
+static void
+iso9660_files_block_size( iso9660_info_t *dummy )
{
- iso9660_VOLUME *volume = (iso9660_VOLUME *)fs->fs_data;
-
- strncpy(buf, volume->descriptor->volume_id, size);
-
- return buf;
+ PUSH(2048);
}
-
-static const char *
-get_fstype( fs_ops_t *fs )
+
+static void
+iso9660_initializer( iso9660_info_t *dummy )
{
- return "ISO9660";
+ fword("register-fs-package");
}
-
-static const fs_ops_t iso9660_ops = {
- .dir = dir_fs,
- .close_fs = umount,
-
- .open_path = open_path,
- .get_path = get_path,
- .close = file_close,
- .read = file_read,
- .lseek = file_lseek,
-
- .vol_name = vol_name,
- .get_fstype = get_fstype,
+
+NODE_METHODS( iso9660 ) = {
+ { "probe", iso9660_files_probe },
+ { "open", iso9660_files_open },
+ { "close", iso9660_files_close },
+ { "read", iso9660_files_read },
+ { "seek", iso9660_files_seek },
+ { "offset", iso9660_files_offset },
+ { "load", iso9660_files_load },
+ { "dir", iso9660_files_dir },
+ { "block-size", iso9660_files_block_size },
+ { NULL, iso9660_initializer },
};
-int
-fs_iso9660_probe( int fd, llong offs )
-{
- if (iso9660_probe(fd, offs))
- return 0;
-
- return -1;
-}
-
-int fs_iso9660_open(int fd, fs_ops_t *fs)
+void
+iso9660_init( void )
{
- iso9660_VOLUME *volume;
-
- volume = iso9660_mount(fd);
- if (volume == NULL)
- return -1;
-
- *fs = iso9660_ops;
- fs->fs_data = volume;
-
- return 0;
+ REGISTER_NODE( iso9660 );
}
Modified: trunk/openbios-devel/packages/disk-label.c
==============================================================================
--- trunk/openbios-devel/packages/disk-label.c Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/packages/disk-label.c Sat Jul 3 16:39:49 2010 (r809)
@@ -16,6 +16,7 @@
#include "config.h"
#include "libopenbios/bindings.h"
+#include "libopenbios/load.h"
#include "libc/diskio.h"
#include "libc/vsprintf.h"
#include "packages.h"
@@ -68,6 +69,8 @@
DPRINTF("dlabel-open '%s'\n", path );
+ di->part_ih = 0;
+
/* Find parent methods */
di->parent_seek_xt = find_parent_method("seek");
di->parent_tell_xt = find_parent_method("tell");
@@ -111,9 +114,16 @@
selfword("find-filesystem");
ph = POP_ph();
if( ph ) {
- push_str( path );
- PUSH_ph( ph );
- fword("interpose");
+ /* If we have been asked to open a particular file, interpose the filesystem package with the passed filename as an argument */
+ DPRINTF("path: %s length: %d\n", path, strlen(path));
+
+ if (strlen(path)) {
+ DPRINTF("INTERPOSE!\n");
+
+ push_str( path );
+ PUSH_ph( ph );
+ fword("interpose");
+ }
} else if (*path && strcmp(path, "%BOOT") != 0) {
goto out;
}
@@ -175,14 +185,24 @@
DPRINTF("load invoked with address %p\n", buf);
- xt = find_ih_method("load", di->part_ih);
- if (!xt) {
- forth_printf("load currently not implemented for ihandle " FMT_ucellx "\n", di->part_ih);
- PUSH(0);
- return;
- }
+ /* If we have a partition handle, invoke the load word on it */
+ if (di->part_ih) {
+ xt = find_ih_method("load", di->part_ih);
+ if (!xt) {
+ forth_printf("load currently not implemented for ihandle " FMT_ucellx "\n", di->part_ih);
+ PUSH(0);
+ return;
+ }
+
+ DPRINTF("calling load on ihandle " FMT_ucellx "\n", di->part_ih);
+
+ call_package(xt, di->part_ih);
+ } else {
+ /* Otherwise attempt load directly on the raw disk */
+ DPRINTF("calling load on raw disk ihandle " FMT_ucellx "\n", my_self());
- call_package(xt, di->part_ih);
+ load(my_self());
+ }
}
NODE_METHODS( dlabel ) = {
Modified: trunk/openbios-devel/packages/init.c
==============================================================================
--- trunk/openbios-devel/packages/init.c Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/packages/init.c Sat Jul 3 16:39:49 2010 (r809)
@@ -30,6 +30,9 @@
#ifdef CONFIG_DISK_LABEL
disklabel_init();
#endif
+#ifdef CONFIG_ISO9660
+ iso9660_init();
+#endif
#ifdef CONFIG_FS
files_init();
#endif
Modified: trunk/openbios-devel/packages/mac-parts.c
==============================================================================
--- trunk/openbios-devel/packages/mac-parts.c Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/packages/mac-parts.c Sat Jul 3 16:39:49 2010 (r809)
@@ -36,6 +36,7 @@
ucell offs_hi, offs_lo;
ucell size_hi, size_lo;
uint blocksize;
+ phandle_t filesystem_ph;
} macparts_info_t;
DECLARE_NODE( macparts, INSTALL_OPEN, sizeof(macparts_info_t), "+/packages/mac-parts" );
@@ -111,6 +112,7 @@
DPRINTF("want_bootcode %d\n", want_bootcode);
DPRINTF("macparts_open %d\n", parnum);
+ di->filesystem_ph = 0;
di->read_xt = find_parent_method("read");
di->seek_xt = find_parent_method("seek");
@@ -244,10 +246,16 @@
ph = POP_ph();
if( ph ) {
- DPRINTF("mac-parts: filesystem found with ph " FMT_ucellx " and args %s\n", ph, str);
- push_str( argstr );
- PUSH_ph( ph );
- fword("interpose");
+ DPRINTF("mac-parts: filesystem found with ph " FMT_ucellx " and args %s\n", ph, argstr);
+ di->filesystem_ph = ph;
+
+ /* If we have been asked to open a particular file, interpose the filesystem package with
+ the passed filename as an argument */
+ if (strlen(argstr)) {
+ push_str( argstr );
+ PUSH_ph( ph );
+ fword("interpose");
+ }
} else {
DPRINTF("mac-parts: no filesystem found; bypassing misc-files interpose\n");
}
Modified: trunk/openbios-devel/packages/misc-files.c
==============================================================================
--- trunk/openbios-devel/packages/misc-files.c Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/packages/misc-files.c Sat Jul 3 16:39:49 2010 (r809)
@@ -66,11 +66,6 @@
}
if( err ) {
- err = fs_iso9660_open(fd, fs);
- DPRINTF("--- ISO9660 returned %d\n", err);
- }
-
- if( err ) {
err = fs_ext2_open(fd, fs);
DPRINTF("--- ext2 returned %d\n", err);
}
@@ -361,11 +356,6 @@
}
if( err ) {
- err = fs_iso9660_probe(fd, offs);
- DPRINTF("--- ISO9660 returned %d\n", err);
- }
-
- if( err ) {
err = fs_ext2_probe(fd, offs);
DPRINTF("--- ext2 returned %d\n", err);
}
Modified: trunk/openbios-devel/packages/packages.h
==============================================================================
--- trunk/openbios-devel/packages/packages.h Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/packages/packages.h Sat Jul 3 16:39:49 2010 (r809)
@@ -20,6 +20,7 @@
extern void deblocker_init( void );
extern void disklabel_init( void );
extern void files_init( void );
+extern void iso9660_init( void );
extern void macparts_init( void );
extern void pcparts_init( void );
extern void sunparts_init( void );
Modified: trunk/openbios-devel/packages/pc-parts.c
==============================================================================
--- trunk/openbios-devel/packages/pc-parts.c Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/packages/pc-parts.c Sat Jul 3 16:39:49 2010 (r809)
@@ -32,6 +32,7 @@
xt_t seek_xt, read_xt;
ucell offs_hi, offs_lo;
ucell size_hi, size_lo;
+ phandle_t filesystem_ph;
} pcparts_info_t;
DECLARE_NODE( pcparts, INSTALL_OPEN, sizeof(pcparts_info_t), "+/packages/pc-parts" );
@@ -134,6 +135,7 @@
if( parnum < 0 )
parnum = 0;
+ di->filesystem_ph = 0;
di->read_xt = find_parent_method("read");
di->seek_xt = find_parent_method("seek");
@@ -264,10 +266,16 @@
ph = POP_ph();
if( ph ) {
- DPRINTF("pc-parts: filesystem found with ph " FMT_ucellx " and args %s\n", ph, str);
- push_str( argstr );
- PUSH_ph( ph );
- fword("interpose");
+ DPRINTF("pc-parts: filesystem found with ph " FMT_ucellx " and args %s\n", ph, argstr);
+ di->filesystem_ph = ph;
+
+ /* If we have been asked to open a particular file, interpose the filesystem package with
+ the passed filename as an argument */
+ if (strlen(argstr)) {
+ push_str( argstr );
+ PUSH_ph( ph );
+ fword("interpose");
+ }
} else {
DPRINTF("pc-parts: no filesystem found; bypassing misc-files interpose\n");
}
Modified: trunk/openbios-devel/packages/sun-parts.c
==============================================================================
--- trunk/openbios-devel/packages/sun-parts.c Sat Jul 3 10:07:59 2010 (r808)
+++ trunk/openbios-devel/packages/sun-parts.c Sat Jul 3 16:39:49 2010 (r809)
@@ -33,6 +33,7 @@
ucell offs_hi, offs_lo;
ucell size_hi, size_lo;
int type;
+ phandle_t filesystem_ph;
} sunparts_info_t;
DECLARE_NODE( sunparts, INSTALL_OPEN, sizeof(sunparts_info_t), "+/packages/sun-parts" );
@@ -152,6 +153,7 @@
DPRINTF("parstr: %s argstr: %s parnum: %d\n", parstr, argstr, parnum);
+ di->filesystem_ph = 0;
di->read_xt = find_parent_method("read");
di->seek_xt = find_parent_method("seek");
@@ -205,10 +207,16 @@
ph = POP_ph();
if( ph ) {
- DPRINTF("sun-parts: filesystem found with ph " FMT_ucellx " and args %s\n", ph, str);
- push_str( argstr );
- PUSH_ph( ph );
- fword("interpose");
+ DPRINTF("sun-parts: filesystem found with ph " FMT_ucellx " and args %s\n", ph, argstr);
+ di->filesystem_ph = ph;
+
+ /* If we have been asked to open a particular file, interpose the filesystem package with
+ the passed filename as an argument */
+ if (strlen(argstr)) {
+ push_str( argstr );
+ PUSH_ph( ph );
+ fword("interpose");
+ }
} else {
DPRINTF("sun-parts: no filesystem found; bypassing misc-files interpose\n");
}
1
0
Author: blueswirl
Date: Sat Jul 3 10:07:59 2010
New Revision: 808
URL: http://tracker.coreboot.org/trac/openbios/changeset/808
Log:
Fix cross compiler detection with dash shell
Based on patch by Andreas Färber.
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/config/scripts/switch-arch
Modified: trunk/openbios-devel/config/scripts/switch-arch
==============================================================================
--- trunk/openbios-devel/config/scripts/switch-arch Sat Jul 3 10:07:57 2010 (r807)
+++ trunk/openbios-devel/config/scripts/switch-arch Sat Jul 3 10:07:59 2010 (r808)
@@ -88,7 +88,7 @@
{
for TARGET in ${1}-linux-gnu- ${1}-elf- ${1}-eabi-
do
- if type -p ${TARGET}gcc > /dev/null
+ if type ${TARGET}gcc > /dev/null 2>&1
then
return
fi
1
0
July 3, 2010
Author: blueswirl
Date: Sat Jul 3 10:07:57 2010
New Revision: 807
URL: http://tracker.coreboot.org/trac/openbios/changeset/807
Log:
Remove unused asm.m4
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Deleted:
trunk/openbios-devel/include/libopenbios/asm.m4
1
0