KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
fs_dcload.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 kernel/arch/dreamcast/include/dc/fs_dcload.h
4 (c)2002 Andrew Kieschnick
5
6*/
7
8/** \file dc/fs_dcload.h
9 \brief Implementation of dcload "filesystem".
10 \ingroup vfs_dcload
11
12 This file contains declarations related to using dcload, both in its -ip and
13 -serial forms. This is only used for dcload-ip support if the internal
14 network stack is not initialized at start via KOS_INIT_FLAGS().
15
16 \author Andrew Kieschnick
17 \see dc/fs_dclsocket.h
18*/
19
20#ifndef __DC_FS_DCLOAD_H
21#define __DC_FS_DCLOAD_H
22
23/* Definitions for the "dcload" file system */
24
25#include <sys/cdefs.h>
26__BEGIN_DECLS
27
28#include <arch/types.h>
29#include <kos/fs.h>
30#include <kos/dbgio.h>
31
32/** \defgroup vfs_dcload PC
33 \brief VFS driver for accessing a remote PC via
34 DC-Load/Tool
35 \ingroup vfs
36
37 @{
38*/
39
40/* \cond */
41extern dbgio_handler_t dbgio_dcload;
42/* \endcond */
43
44/* dcload magic value */
45/** \brief The dcload magic value! */
46#define DCLOADMAGICVALUE 0xdeadbeef
47
48/** \brief The address of the dcload magic value */
49#define DCLOADMAGICADDR (unsigned int *)0x8c004004
50
51/* Are we using dc-load-serial or dc-load-ip? */
52#define DCLOAD_TYPE_NONE -1 /**< \brief No dcload connection */
53#define DCLOAD_TYPE_SER 0 /**< \brief dcload-serial connection */
54#define DCLOAD_TYPE_IP 1 /**< \brief dcload-ip connection */
55
56/** \brief What type of dcload connection do we have? */
57extern int dcload_type;
58
59/* \cond */
60/* Available dcload console commands */
61
62#define DCLOAD_READ 0
63#define DCLOAD_WRITE 1
64#define DCLOAD_OPEN 2
65#define DCLOAD_CLOSE 3
66#define DCLOAD_CREAT 4
67#define DCLOAD_LINK 5
68#define DCLOAD_UNLINK 6
69#define DCLOAD_CHDIR 7
70#define DCLOAD_CHMOD 8
71#define DCLOAD_LSEEK 9
72#define DCLOAD_FSTAT 10
73#define DCLOAD_TIME 11
74#define DCLOAD_STAT 12
75#define DCLOAD_UTIME 13
76#define DCLOAD_ASSIGNWRKMEM 14
77#define DCLOAD_EXIT 15
78#define DCLOAD_OPENDIR 16
79#define DCLOAD_CLOSEDIR 17
80#define DCLOAD_READDIR 18
81#define DCLOAD_GETHOSTINFO 19
82#define DCLOAD_GDBPACKET 20
83
84/* dcload syscall function */
85
86int dcloadsyscall(unsigned int syscall, ...);
87
88/* dcload dirent */
89
90struct dcload_dirent {
91 long d_ino; /* inode number */
92 off_t d_off; /* offset to the next dirent */
93 unsigned short d_reclen;/* length of this record */
94 unsigned char d_type; /* type of file */
95 char d_name[256]; /* filename */
96};
97
98typedef struct dcload_dirent dcload_dirent_t;
99
100/* dcload stat */
101
102struct dcload_stat {
103 unsigned short st_dev;
104 unsigned short st_ino;
105 int st_mode;
106 unsigned short st_nlink;
107 unsigned short st_uid;
108 unsigned short st_gid;
109 unsigned short st_rdev;
110 long st_size;
111 long atime;
112 long st_spare1;
113 long mtime;
114 long st_spare2;
115 long ctime;
116 long st_spare3;
117 long st_blksize;
118 long st_blocks;
119 long st_spare4[2];
120};
121
122typedef struct dcload_stat dcload_stat_t;
123
124/* Printk replacement */
125void dcload_printk(const char *str);
126
127/* GDB tunnel */
128size_t dcload_gdbpacket(const char* in_buf, size_t in_size, char* out_buf, size_t out_size);
129
130/* File functions */
131void* dcload_open(vfs_handler_t * vfs, const char *fn, int mode);
132int dcload_close(void * hnd);
133ssize_t dcload_read(void * hnd, void *buf, size_t cnt);
134off_t dcload_seek(void * hnd, off_t offset, int whence);
135off_t dcload_tell(void * hnd);
136size_t dcload_total(void * hnd);
137dirent_t* dcload_readdir(void * hnd);
138int dcload_rename(vfs_handler_t * vfs, const char *fn1, const char *fn2);
139int dcload_unlink(vfs_handler_t * vfs, const char *fn);
140
141/* Init func */
142void fs_dcload_init_console(void);
143void fs_dcload_init(void);
144void fs_dcload_shutdown(void);
145
146/* Init func for dcload-ip + lwIP */
147int fs_dcload_init_lwip(void *p);
148
149/* \endcond */
150
151/** @} */
152
153__END_DECLS
154
155#endif /* __DC_FS_DCLOAD_H */
Debug I/O.
Virtual filesystem support.
int dcload_type
What type of dcload connection do we have?
Debug I/O Interface.
Definition dbgio.h:39
Directory entry.
Definition fs.h:52
VFS handler interface.
Definition fs.h:105
Common integer types.