[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: oskit-mach: device_write

From: Daniel Wagner
Subject: Re: oskit-mach: device_write
Date: Wed, 6 Mar 2002 22:43:18 +0100
User-agent: Mutt/1.3.24i

Sorry for being so unclear, I'm trying to be more specific.

I was referring to this (stolen from the mach docs):

kern_return_t device_write (device_t device, 
                            dev_mode_t mode, 
                            recnum_t recnum, 
                            io_buf_ptr_t data, 
                            mach_msg_type_number_t data_count, 
                            int *bytes_written)

The function device_write writes data_count bytes from the buffer data 
to device. The number of bytes actually written is returned in bytes_written. 

In order to trigger the bug again, I setted data_count to 4. bytes_written
return the value 18677512. But bytes_written does not match to size which
the driver returns:

Breakpoint 3, ds_device_write (dev=0xc107fc8, reply_port=0xc1226c4, 
    reply_port_type=18, mode=8, recnum=0, data=0xc114df4 "\003", count=4, 
    bytes_written=0xc2bf034) at ../../oskit-mach/oskit/ds_routines.c:695
695       if (dev == DEVICE_NULL)
(gdb) n
697       if (!(dev->mode & D_WRITE))
699       if (! data)
701       if (! dev->ops->write)
703           if (!dev->ops->write_inband)
713               kern_return_t kr = vm_map_copyout (device_io_map, &addr,
715               if (kr != KERN_SUCCESS)
719               kr = (*dev->ops->write_inband) (dev, reply_port,
723               (void) vm_deallocate (device_io_map, addr, count);
(gdb) p bytes_written
$1 = (int *) 0xc2bf034
(gdb) p *bytes_written
$2 = 61


Daniel Wagner                       "Don't drink and derive."        
email: wagi@gmx.ch

GnuPG: 1024D/DCDE890A (public key available on any keyserver)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]