NBD kernel module

'make menuconfig' is better than the interactive series of questions.
It fails to build at all. Complains about missing curses.h or something. Curses is rather apt for my thoughts at this point.
I've never tried using ARCH= in the command line... may be part of the problem.
OK, I was sort of guessing and clutching at any straw and it seemed to work. Have tried it without and it makes no difference whatsoever. File is still 64 bytes shorter. Have tried a different VM/OS version and likewise.
(Looking at the Makefile again it seems hard-coded to set "mips" anyway.)

Oh, I see now, I'm not supposed to set the "CROSS_COMPILE" on "make menuconfig". It also makes no difference on "make config", so xyz321 including it above was a bit of duff gen.

Still not got a successful build of the driver which works though...
 
It fails to build at all. Complains about missing curses.h or something. Curses is rather apt for my thoughts at this point.
Try installing nucurses-devel or similar for your host (not part of the cross compiler) environment.
Still not got a successful build of the driver which works though...

Try enabling CONFIG_LBD (not a module).

Sorry about the config/menuconfig confusion - it has been a while.
 
Last edited:
Still not got a successful build of the driver which works though...
I can't get at my cross compilation environment at the moment but I haven't done anything special to get it to work. Just downloaded the compiler from the Humax open source site and unpacked it into /opt, added it to my path then extracted the kernel source that they provide and dropped their config in as .config. There are some additional patches required to build the kernel itself but the modules should be fine.
I think my VM is an old version of Debian - I don't recall having to do anything special about the GNU make utility either.
 
Try installing nucurses-devel or similar for your host (not part of the cross compiler) environment.
Just to be clear, it works fine when built native. It fails when cross-compiled. But as its only use is native, that makes sense.
It's still easier to edit the .config file directly - I haven't yet found where the options are in menuconfig that I've manually set...
Try enabling CONFIG_LBD (not a module).
Ah, that's more like it. File size is correct now. The only difference is these two bytes which looks like some sort of symbol table:
Code:
--- af123
+++ prpr
@@ -672,8 +672,8 @@
00002be0  65 71 75 65 73 74 00 6e  62 64 5f 63 6c 65 61 72  |equest.nbd_clear|
00002bf0  5f 71 75 65 00 6e 62 64  5f 69 6e 69 74 00 64 6f  |_que.nbd_init.do|
00002c00  5f 6e 62 64 5f 72 65 71  75 65 73 74 00 6e 62 64  |_nbd_request.nbd|
-00002c10  5f 6c 6f 63 6b 00 5f 5f  6b 65 79 2e 32 33 36 32  |_lock.__key.2362|
-00002c20  38 00 6e 62 64 5f 66 6f  70 73 00 6e 62 64 5f 69  |8.nbd_fops.nbd_i|
+00002c10  5f 6c 6f 63 6b 00 5f 5f  6b 65 79 2e 32 33 36 30  |_lock.__key.2360|
+00002c20  39 00 6e 62 64 5f 66 6f  70 73 00 6e 62 64 5f 69  |9.nbd_fops.nbd_i|
00002c30  6f 63 74 6c 00 5f 5f 6d  6f 64 5f 64 65 62 75 67  |octl.__mod_debug|
00002c40  66 6c 61 67 73 37 30 32  00 5f 5f 6d 6f 64 5f 64  |flags702.__mod_d|
00002c50  65 62 75 67 66 6c 61 67  73 74 79 70 65 37 30 31  |ebugflagstype701|
I guess this isn't significant?
 
I can't get at my cross compilation environment at the moment but I haven't done anything special to get it to work. Just downloaded the compiler from the Humax open source site and unpacked it into /opt, added it to my path then extracted the kernel source that they provide and dropped their config in as .config. There are some additional patches required to build the kernel itself but the modules should be fine.
I think my VM is an old version of Debian - I don't recall having to do anything special about the GNU make utility either.
That's all I did too. Ubuntu 14.04 shipped with Make 3.81; 15.04 seems to have Make 4.0 and I was trying to build on 15.04 at first.
Apparently Make was 'broken' in terms of backwards compatibility from 3.82 onwards.
 
Here's my full kernel config file:

Code:
humax-dev# (25) egrep -v '^(#|$)' ~/kernel/stblinux-2.6.18-7.1_r3761/.config
CONFIG_MIPS=y
CONFIG_MIPS_BCM7405BX=y
CONFIG_BRCM_BUILD_TARGET="unknown"
CONFIG_LONG_LONG_SUPPORT=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
CONFIG_DMA_NONCOHERENT=y
CONFIG_DMA_NEED_PCI_MAP_STATE=y
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
CONFIG_IRQ_CPU=y
CONFIG_MIPS_BRCM97XXX=y
CONFIG_BMIPS4380=y
CONFIG_MIPS_BCM7405B0=y
CONFIG_MIPS_BCM7405=y
CONFIG_MIPS_BRCM=y
CONFIG_SERIAL=y
CONFIG_BRCM_SKIP_CHECK_BOOTROM=y
CONFIG_MIPS_L1_CACHE_SHIFT=6
CONFIG_SYS_SUPPORTS_PM=y
CONFIG_SYS_SUPPORTS_CPUFREQ=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_BRCM=y
CONFIG_BRCM_PM=y
CONFIG_CPU_MIPS32_R1=y
CONFIG_SYS_HAS_CPU_MIPS32_R1=y
CONFIG_CPU_MIPS32=y
CONFIG_CPU_MIPSR1=y
CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
CONFIG_32BIT=y
CONFIG_PAGE_SIZE_4KB=y
CONFIG_CPU_HAS_PREFETCH=y
CONFIG_MIPS_MT_DISABLED=y
CONFIG_CPU_HAS_LLSC=y
CONFIG_CPU_HAS_SYNC=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_IRQ_PER_CPU=y
CONFIG_CPU_SUPPORTS_HIGHMEM=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_SMP=y
CONFIG_SYS_SUPPORTS_SMP=y
CONFIG_NR_CPUS=2
CONFIG_HZ_1000=y
CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
CONFIG_HZ=1000
CONFIG_PREEMPT_NONE=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_EMBEDDED=y
CONFIG_SYSCTL=y
CONFIG_KALLSYMS=y
CONFIG_HOTPLUG=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SHMEM=y
CONFIG_SLAB=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_STOP_MACHINE=y
CONFIG_LBD=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_AS=y
CONFIG_DEFAULT_IOSCHED="anticipatory"
CONFIG_HW_HAS_PCI=y
CONFIG_PCI=y
CONFIG_MMU=y
CONFIG_BINFMT_ELF=y
CONFIG_TRAD_SIGNALS=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_NETFILTER=y
CONFIG_NETFILTER_XTABLES=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_FILTER=y
CONFIG_WIRELESS_EXT=y
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_MTD=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_NOSWAP=y
CONFIG_MTD_CFI_GEOMETRY=y
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
CONFIG_MTD_OTP=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_UTIL=y
CONFIG_FLASH_LOCK_CTRL=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=0x1e000000
CONFIG_MTD_PHYSMAP_LEN=0x2000000
CONFIG_MTD_PHYSMAP_BANKWIDTH=2
CONFIG_MTD_BCM7XXX=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=m
CONFIG_SCSI=y
CONFIG_SCSI_PROC_FS=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
CONFIG_ATA=y
CONFIG_SATA_SVW=y
CONFIG_SATA_SVW_PORTS=2
CONFIG_NETDEVICES=y
CONFIG_NETIF_DMA=y
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
CONFIG_BCMINTEMAC_7038=y
CONFIG_BCMINTEMAC_NETLINK=y
CONFIG_BCMINTEMAC_7038_STREAMING=y
CONFIG_NET_RADIO=y
CONFIG_NET_WIRELESS_RTNETLINK=y
CONFIG_NET_WIRELESS=y
CONFIG_INPUT=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ATKBD=y
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=y
CONFIG_SERIO_LIBPS2=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=0
CONFIG_SERIAL_8250_RUNTIME_UARTS=0
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_HW_RANDOM=y
CONFIG_HWMON=y
CONFIG_FIRMWARE_EDID=y
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_DEVICEFS=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_BRCM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_HID=y
CONFIG_USB_HIDINPUT=y
CONFIG_USB_MON=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_JBD=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FUSE_FS=m
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
CONFIG_NTFS_FS=y
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_RAMFS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
CONFIG_JFFS2_CMODE_PRIORITY=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_EMBEDDED=y
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
CONFIG_SQUASHFS_VMALLOC=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_UTF8=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_LOG_BUF_SHIFT=15
CONFIG_CROSSCOMPILE=y
CONFIG_CMDLINE="root=/dev/sda1 rw console=uart,mmio,0x10400b00,115200n8"
CONFIG_SYS_SUPPORTS_KGDB=y
CONFIG_CRC32=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_PLIST=y
 
Please could you include the comments in the kernel config listing? If I run 'make menuconfig' it fills in the missing comments but enables some values by default e.g 'CONFIG_PRINTK'. Alternatively, if I use 'make oldconfig' to try to regenerate the comments then it prompts for every missing option.
 
Last edited:
Here's my full kernel config file:
That's made a world of difference. My build of nbd.ko now matches yours and my build of aoe.ko works without killing the Humax.
I copied /dev to /mod/dev and then mounted /mod/dev back on /dev and all is happy. Device /dev/etherd!e0.1 gets created automatically (although it's called /dev/etherd/e0.1 on Ubuntu). Haven't even needed any aoetools utilities so far.
Testing a file copy on AOE at the moment... about 80Mbps. Doesn't need a messy nbd-client daemon either. :D
 
Please could you include the comments in the kernel config listing? If I run 'make menuconfig' it fills in the missing comments but enables some values by default e.g 'CONFIG_PRINTK'. Alternatively, if I use 'make oldconfig' to try to regenerate the comments then it prompts for every missing option.
Yes, I got that and then had to do it the hard way. Was not pleasant. Should have been asleep too.
 
Are you using vblade to create an AOE target ?
Yes.

Further experiments since have been rather trying. Neither nbd.ko nor aoe.ko will run on the HD at all. They both segfault on loading. I built my own dummy do-nothing module and it didn't crash, so it must be something in the drivers' code. I started commenting stuff out, and could stop the crashes, but nothing useful got done in the driver either that way. There can't really be anything wrong with the stock driver code and the kernel calls the drivers make, so it must be something to do with the build process. It's very dull and time consuming trying stuff without even printk() as well.

More tests on the HDR reveal that both modules are initially OK, but hang the machine after a couple of hours or so (such that it responds to Ping and accepts socket connections, but you don't get any data flow, so no Telnet or anything else; and no response to the remote either) and you have to power cycle.
I'm rather out of ideas at this point. So near but so far...
 
Bit off topic but . . .

I'm sure that we can all find multiple uses of three letter acronyms such as ATM :-
Automatic Teller Machine, Air Traffic Management, Awareness Though Movement, At The Moment, (the one below) etc.
But the different possibilities don't usually overlap so it is usually fairly obvious which one is meant in a sentence, even when one of the letters in the acronym is itself an acronym, however the use of AOE (or AoE) initially confused me, you have :-
1) (Advanced Technology Attachment) Over Ethernet = the one you are referring to, but also
2) (Asynchronous Transfer Mode) Over Ethernet = transport of voice, data, video etc. in fixed size packets

I wasn't aware of #1) above, but I used to test #2), so when AoE cropped up in this thread, I initially though I knew what you were talking about :)
 
This makes me wonder if the other kernel modules are stable. Some (all?) predate the change to the kernel to enable large block devices.
They all seem to be stable and all are from 2011. Is that before LBD?
I think you're the only one who has created all the .ko modules I've seen so far (cifs, exportfs, fuse, nfsd) and they all work on both HDR and HD, so how did you do it? There must be something fundamental that others who have tried are doing wrong.
 
Back
Top