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 Copyright (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#include <sys/cdefs.h>
24__BEGIN_DECLS
25
26#include <kos/fs.h>
27#include <kos/dbgio.h>
28
29/** \defgroup vfs_dcload PC
30 \brief VFS driver for accessing a remote PC via
31 DC-Load/Tool
32 \ingroup vfs
33
34 @{
35*/
36
37/* \cond */
38extern dbgio_handler_t dbgio_dcload;
39/* \endcond */
40
41/* dcload magic value */
42/** \brief The dcload magic value! */
43#define DCLOADMAGICVALUE 0xdeadbeef
44
45/** \brief The address of the dcload magic value */
46#define DCLOADMAGICADDR (uint32_t *)0x8c004004
47
48/* Are we using dc-load-serial or dc-load-ip? */
49#define DCLOAD_TYPE_NONE -1 /**< \brief No dcload connection */
50#define DCLOAD_TYPE_SER 0 /**< \brief dcload-serial connection */
51#define DCLOAD_TYPE_IP 1 /**< \brief dcload-ip connection */
52
53/** \brief What type of dcload connection do we have? */
54extern int dcload_type;
55
56/* \cond */
57/* Available dcload console commands */
58#define DCLOAD_READ 0
59#define DCLOAD_WRITE 1
60#define DCLOAD_OPEN 2
61#define DCLOAD_CLOSE 3
62#define DCLOAD_CREAT 4
63#define DCLOAD_LINK 5
64#define DCLOAD_UNLINK 6
65#define DCLOAD_CHDIR 7
66#define DCLOAD_CHMOD 8
67#define DCLOAD_LSEEK 9
68#define DCLOAD_FSTAT 10
69#define DCLOAD_TIME 11
70#define DCLOAD_STAT 12
71#define DCLOAD_UTIME 13
72#define DCLOAD_ASSIGNWRKMEM 14
73#define DCLOAD_EXIT 15
74#define DCLOAD_OPENDIR 16
75#define DCLOAD_CLOSEDIR 17
76#define DCLOAD_READDIR 18
77#define DCLOAD_GETHOSTINFO 19
78#define DCLOAD_GDBPACKET 20
79#define DCLOAD_REWINDDIR 21
80
81/* dcload syscall function */
82int dcloadsyscall(uint32_t syscall, ...);
83
84/* dcload dirent */
85struct dcload_dirent {
86 int d_ino; /* inode number */
87 off_t d_off; /* offset to the next dirent */
88 uint16_t d_reclen; /* length of this record */
89 uint8_t d_type; /* type of file */
90 char d_name[256]; /* filename */
91};
92
93typedef struct dcload_dirent dcload_dirent_t;
94
95/* dcload stat */
96typedef struct dcload_stat {
97 uint16_t st_dev;
98 uint16_t st_ino;
99 int st_mode;
100 uint16_t st_nlink;
101 uint16_t st_uid;
102 uint16_t st_gid;
103 uint16_t st_rdev;
104 int st_size;
105 int atime;
106 int st_spare1;
107 int mtime;
108 int st_spare2;
109 int ctime;
110 int st_spare3;
111 int st_blksize;
112 int st_blocks;
113 int st_spare4[2];
114} dcload_stat_t;
115
116/* Printk replacement */
117void dcload_printk(const char *str);
118
119/* GDB tunnel */
120size_t dcload_gdbpacket(const char *in_buf, size_t in_size, char *out_buf, size_t out_size);
121
122/* Init func */
123void fs_dcload_init_console(void);
124void fs_dcload_init(void);
125void fs_dcload_shutdown(void);
126
127/* \endcond */
128
129/** @} */
130
131__END_DECLS
132
133#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