Error ENODEV while opening vnode for swapping pages


I need to open a vnode for swapping pages to disk. The comments in vfs.h indicate that I can access lhd0 as a known device by passing path name as “lhd0raw:” since mountable flag is set for device lhd.

However, when I try to open the vnode it returns an error code 25 which corresponds to “no such device”. Do I need to mount the device using vfs_mount before accessing it fro swapping pages?

Check your sys161.conf and make sure you are actually creating a virtual disk. IIRC you shouldn’t need to mount it—although someone should correct me if I’m wrong.

You are likely missing steps laid out in sys161.conf:

# You will need to reenable disks before working on ASST3 and ASST4. Here is
# a suggested default configuration: 512k RAM, two disks. The first is marked
# nodoom on the assumption that it will be a swap disk. 5M is probably a good
# default disk size.
# Create the disk images with:
   # disk161 create LHD0.img 5M
   # disk161 create LHD1.img 5M

2	disk	rpm=7200	size=32M 	file=LHD0.img   nodoom
3	disk	rpm=7200	size=32M 	file=LHD1.img

Yea my bad. Thanks that worked :slight_smile:

1 Like