Hi !
I have a question for any of you out there with a deep understanding
of the workings of device drivers for the OSF/1 kernel.
We can do something that *works* but (silly me) I'm just wondering if
anyone out there can explain WHY it works.
Facts: OSF/1 V.1.3 - need to add capability to add a 4th (LVM) volume.
In the sysadmin manual it states "LVM supports a maximum of 3 logical
volume groups" - so we don't expect to get any help from DEC.
Someone who worked here before me and has since gone on to greener pastures
was able configure a kernel to permit 4
by :
1) adding "pseudo-device lv 4" to the system configuration file
and
2) modify /sys/common/io/conf.c - to add major device 11 as a 4th log vol.
Can anyone explain the changes below *especially* the "dummy open fix"
change?
diff -b -c5 conf.c conf.c.orig
*** conf.c Sun Aug 20 15:59:33 1995
--- conf.c.orig Tue Sep 6 12:14:10 1994
***************
*** 390,455 ****
#define lv_ioctl2 nodev
#define lv_volgrp2 0
#endif /* NLV > 2 */
#if NLV > 3
- #if NPRESTO > 0
- /* declare Prestoserve NVRAM psuedo-driver interface routines and structs */
- int lv_open3(), lv_close3();
- int lv_strategy3();
- int lv_read3(), lv_write3();
- #define lv_ioctl3 lv_ioctl
- #define lv_volgrp3 ((struct tty *)&lv_volgrp[3])
- #else
- #define lv_open3 lv_open
- #define lv_close3 lv_close
- #define lv_strategy3 (int (*)())lv_strategy
- #define lv_read3 lv_read
- #define lv_write3 lv_write
- #define lv_ioctl3 lv_ioctl
- #define lv_volgrp3 ((struct tty *)&lv_volgrp[3])
- #endif /* NPRESTO > 0 */
-
- #else
- #define lv_open3 nodev
- #define lv_close3 nodev
- #define lv_strategy3 nodev
- #define lv_read3 nodev
- #define lv_write3 nodev
- #define lv_ioctl3 nodev
- #define lv_volgrp3 0
- #endif /* NLV > 3 */
- #if NLV > 4
error Need to add more declarations to conf.c to configure this many LVMs.
#endif
#if NSII == 0
--- 390,399 ----
***************
*** 780,796 ****
#endif /* MAX_BDEVSW */
dswlock_t bdevlock[MAX_BDEVSW]; /* bdevsw lock structure */
- static int dummy_open_fix() {return nodev();}
/*
%%% BEGIN BDEVSW TABLE (first 3 chars of this line must be %%%
*/
struct bdevsw bdevsw[MAX_BDEVSW] =
{
! { dummy_open_fix, nodev, nodev, nodev,
/*0*/
nodev, 0, nodev, DEV_FUNNEL_NULL },
/* SAS/RAM disk device */
{ mdopen, nulldev, mdstrategy, nodev, /*1*/
md_size, 0, nodev ,DEV_FUNNEL_NULL },
/* swap, defunct */
--- 724,739 ----
#endif /* MAX_BDEVSW */
dswlock_t bdevlock[MAX_BDEVSW]; /* bdevsw lock structure */
/*
%%% BEGIN BDEVSW TABLE (first 3 chars of this line must be %%%
*/
struct bdevsw bdevsw[MAX_BDEVSW] =
{
! { nodev, nodev, nodev, nodev, /*0*/
nodev, 0, nodev, DEV_FUNNEL_NULL },
/* SAS/RAM disk device */
{ mdopen, nulldev, mdstrategy, nodev, /*1*/
md_size, 0, nodev ,DEV_FUNNEL_NULL },
/* swap, defunct */
***************
*** 838,850 ****
/* Unused entry (10) */
{ nodev, nodev, nodev, nodev, /*10*/
0, 0, nodev ,DEV_FUNNEL_NULL },
#endif
! /* Logical Volume Manager - cmajor and bmajor must match */
! { lv_open3, lv_close3, lv_strategy3, nodev, /*11*
/
! 0, 0, lv_ioctl3 ,DEV_FUNNEL_NULL },
/* Unused entry (12) */
{ nodev, nodev, nodev, nodev, /*12*
/
0, 0, nodev ,DEV_FUNNEL_NULL },
--- 781,793 ----
/* Unused entry (10) */
{ nodev, nodev, nodev, nodev, /*10*/
0, 0, nodev ,DEV_FUNNEL_NULL },
#endif
! /* Unused entry (11) */
! { nodev, nodev, nodev, nodev, /*11*/
! 0, 0, nodev ,DEV_FUNNEL_NULL },
/* Unused entry (12) */
{ nodev, nodev, nodev, nodev, /*12*/
0, 0, nodev ,DEV_FUNNEL_NULL },
***************
*** 1285,1297 ****
nodev, nodev, nulldev, 0,
nodev, nodev, DEV_FUNNEL_NULL },
#endif
#endif
! /* Logical Volume Manager device - cmajor and bmajor must match */
! { lv_open3, lv_close3, lv_read3, lv_write3, /*11*
/
! lv_ioctl3, nodev, nulldev, lv_volgrp3,
nodev, nodev, DEV_FUNNEL_NULL },
/* This was the vice fs device */
{ nulldev, nulldev, nodev, nodev, /*12*/
nodev, nodev, nulldev, 0,
--- 1228,1240 ----
nodev, nodev, nulldev, 0,
nodev, nodev, DEV_FUNNEL_NULL },
#endif
#endif
! /* This is the "trace" device on Pmax */
! { nulldev, nulldev, nodev, nodev, /*11*/
! nodev, nodev, nulldev, 0,
nodev, nodev, DEV_FUNNEL_NULL },
/* This was the vice fs device */
{ nulldev, nulldev, nodev, nodev, /*12*/
nodev, nodev, nulldev, 0,
TIA
-----------------------------------------------------------------------------
Shanna Leonard ssl_at_alpha.sunquest.com
Unix Systems Group
Sunquest Information Systems
Received on Sun Aug 20 1995 - 23:58:45 NZST