/DragonOS-0.1.8/kernel/src/libs/libUI/ |
D | screen_manager.c | 32 …struct scm_buffer_info_t *buf = (struct scm_buffer_info_t *)kmalloc(sizeof(struct scm_buffer_info_… in __create_buffer() local 33 if (buf == NULL) in __create_buffer() 35 memset(buf, 0, sizeof(struct scm_buffer_info_t)); in __create_buffer() 36 buf->bit_depth = video_frame_buffer_info.bit_depth; in __create_buffer() 37 buf->flags = SCM_BF_DB; in __create_buffer() 40 buf->flags |= SCM_BF_PIXEL; in __create_buffer() 42 buf->flags |= SCM_BF_TEXT; in __create_buffer() 43 buf->height = video_frame_buffer_info.height; in __create_buffer() 44 buf->width = video_frame_buffer_info.width; in __create_buffer() 45 buf->size = video_frame_buffer_info.size; in __create_buffer() [all …]
|
D | screen_manager.h | 36 int (*install)(struct scm_buffer_info_t *buf); // 安装ui框架的回调函数 40 int (*change)(struct scm_buffer_info_t *buf); // 改变ui框架的帧缓冲区的回调函数 49 struct scm_buffer_info_t *buf; member
|
D | textui.c | 72 int textui_install_handler(struct scm_buffer_info_t *buf) in textui_install_handler() argument 98 int textui_change_handler(struct scm_buffer_info_t *buf) in textui_change_handler() argument 100 memcpy((void *)buf->vaddr, (void *)(textui_framework.buf->vaddr), textui_framework.buf->size); in textui_change_handler() 101 textui_framework.buf = buf; in textui_change_handler() 340 uint16_t chars_per_vline = textui_framework.buf->width / TEXTUI_CHAR_WIDTH; in textui_init() 341 uint16_t total_vlines = textui_framework.buf->height / TEXTUI_CHAR_HEIGHT; in textui_init() 357 __private_info.actual_line = textui_framework.buf->height / TEXTUI_CHAR_HEIGHT; in textui_init()
|
/DragonOS-0.1.8/user/apps/shell/ |
D | shell.c | 22 int shell_readline(int fd, char *buf); 110 void clear_command(int count, char *buf) in clear_command() argument 114 memset(buf, 0, sizeof(buf)); in clear_command() 122 void change_command(char *buf, int type) in change_command() argument 141 strcpy(buf, history_commands[current_command_index]); in change_command() 142 printf("%s", buf); in change_command() 152 int shell_readline(int fd, char *buf) in shell_readline() argument 173 clear_command(count, buf); in shell_readline() 176 change_command(buf, 1); in shell_readline() 177 count = strlen(buf); in shell_readline() [all …]
|
D | cmd.c | 262 struct dirent *buf = NULL; in shell_cmd_ls() local 267 buf = readdir(dir); in shell_cmd_ls() 268 if (buf == NULL) in shell_cmd_ls() 272 if (buf->d_type == DT_DIR) in shell_cmd_ls() 274 else if (buf->d_type == DT_REG) in shell_cmd_ls() 276 else if (buf->d_type == DT_BLK || buf->d_type == DT_CHR) in shell_cmd_ls() 281 sprintf(output_buf, "%s ", buf->d_name); in shell_cmd_ls() 333 char *buf = (char *)malloc(512); in shell_cmd_cat() local 337 memset(buf, 0, 512); in shell_cmd_cat() 338 int l = read(fd, buf, 511); in shell_cmd_cat() [all …]
|
D | cmd_test.c | 32 char buf[buf_SIZE] = {0}; in shell_pipe_test() local 33 n = read(fd[0], buf, buf_SIZE); // 从管道的读端读取一条消息 in shell_pipe_test() 37 printf("Child process received message: %s\n", buf); // 打印收到的消息 in shell_pipe_test() 38 if (strcmp(buf, "quit") == 0) in shell_pipe_test()
|
/DragonOS-0.1.8/kernel/src/driver/tty/ |
D | mod.rs | 105 pub fn input(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in input() 107 let val = self.write_stdin(buf, block)?; in input() 110 self.write_output(&buf[0..val], true)?; in input() 122 pub fn output(&self, buf: &mut [u8], block: bool) -> Result<usize, TtyError> { in output() 123 return self.read_output(buf, block); in output() 133 pub fn stdout(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in stdout() 134 return self.write_output(buf, block); in stdout() 144 pub fn stderr(&self, buf: &[u8], block: bool) -> Result<usize, TtyError> { in stderr() 145 return self.write_output(buf, block); in stderr() 155 pub fn read_stdin(&self, buf: &mut [u8], block: bool) -> Result<usize, TtyError> { in read_stdin() [all …]
|
D | tty_device.rs | 78 pub fn check_rw_param(&self, len: usize, buf: &[u8]) -> Result<(), SystemError> { in check_rw_param() 79 if len > buf.len() { in check_rw_param() 86 pub fn input(&self, buf: &[u8]) -> Result<usize, SystemError> { in input() 87 let r: Result<usize, TtyError> = self.core.input(buf, false); in input() 146 buf: &mut [u8], in read_at() 156 self.check_rw_param(len, buf)?; in read_at() 159 let r: Result<usize, TtyError> = self.core.read_stdin(&mut buf[0..len], true); in read_at() 180 buf: &[u8], in write_at() 191 self.check_rw_param(len, buf)?; in write_at() 195 self.core.stdout(&buf[0..len], true) in write_at() [all …]
|
/DragonOS-0.1.8/user/libs/libc/src/ |
D | stdio.c | 10 char *buf = malloc(bufsize); in fprintf() local 11 memset(buf, 0, bufsize); in fprintf() 15 vsprintf(buf, format, args); in fprintf() 18 int len = strlen(buf); in fprintf() 22 buf[bufsize - 1] = 0; in fprintf() 24 write(stream->fd, buf, len); in fprintf() 25 free(buf); in fprintf()
|
D | unistd.c | 28 ssize_t read(int fd, void *buf, size_t count) in read() argument 30 return (ssize_t)syscall_invoke(SYS_READ, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in read() 41 ssize_t write(int fd, void const *buf, size_t count) in write() argument 43 return (ssize_t)syscall_invoke(SYS_WRITE, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in write() 195 unsigned char buf[32]; in swab() local 202 memcpy(buf, _src, transfer); in swab() 204 memcpy(_dest, buf, transfer); in swab()
|
D | dirent.c | 70 memset((dir->buf), 0, DIR_BUF_SIZE); in readdir() 72 int len = getdents(dir->fd, (struct dirent *)dir->buf, DIR_BUF_SIZE); in readdir() 75 return (struct dirent *)dir->buf; in readdir()
|
D | printf.c | 43 char buf[4096]; in printf() local 48 count = vsprintf(buf, fmt, args); in printf() 51 write(1, buf, count); in printf() 55 int sprintf(char *buf, const char *fmt, ...) in sprintf() argument 61 count = vsprintf(buf, fmt, args); in sprintf() 74 int vsprintf(char *buf, const char *fmt, va_list args) in vsprintf() argument 81 str = buf; in vsprintf() 325 *ip = str - buf; in vsprintf() 349 return str - buf; in vsprintf()
|
/DragonOS-0.1.8/kernel/src/libs/ |
D | vec_cursor.rs | 101 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SystemError> { in read_exact() 102 if self.pos + buf.len() > self.data.len() { in read_exact() 105 buf.copy_from_slice(&self.data[self.pos..self.pos + buf.len()]); in read_exact() 106 self.pos += buf.len(); in read_exact() 113 pub fn read_u16_into(&mut self, buf: &mut [u16]) -> Result<(), SystemError> { in read_u16_into() 114 if self.pos + buf.len() * size_of::<u16>() > self.data.len() * size_of::<u16>() { in read_u16_into() 118 for i in 0..buf.len() { in read_u16_into() 119 buf[i] = self.read_u16()?; in read_u16_into() 216 pub fn write_exact(&mut self, buf: &[u8]) -> Result<(), SystemError> { in write_exact() 217 if self.pos + buf.len() > self.data.len() { in write_exact() [all …]
|
D | unistd.c | 26 unsigned char buf[32]; in swab() local 33 memcpy(buf, _src, transfer); in swab() 35 memcpy(_dest, buf, transfer); in swab()
|
D | printk.c | 54 static int __do_vsprintf(char *buf, const char *fmt, int buf_size, va_list args) in __do_vsprintf() argument 62 str = buf; in __do_vsprintf() 72 end = buf + buf_size; in __do_vsprintf() 310 *ip = str - buf; in __do_vsprintf() 354 return str - buf; in __do_vsprintf() 364 int vsprintf(char *buf, const char *fmt, va_list args) in vsprintf() argument 366 return __do_vsprintf(buf, fmt, -1, args); in vsprintf() 378 int vsnprintf(char *buf, const char *fmt, int buf_size, va_list args) in vsnprintf() argument 380 return __do_vsprintf(buf, fmt, buf_size, args); in vsnprintf() 602 char buf[4096]; // vsprintf()的缓冲区 in printk_color() local [all …]
|
/DragonOS-0.1.8/kernel/src/common/ |
D | stdio.h | 11 extern int vsprintf(char *buf, const char *fmt, va_list args); 13 extern int sprintk(char *buf, const char *fmt, ...);
|
D | printk.h | 50 int vsprintf(char *buf, const char *fmt, va_list args); 61 int vsnprintf(char *buf, const char *fmt, int buf_size, va_list args); 83 int sprintk(char *buf, const char *fmt, ...);
|
/DragonOS-0.1.8/kernel/src/driver/disk/ |
D | ata.c | 24 unsigned char buf[64]; in ata_disk_handler() local 30 buf[js++]=(info.Serial_Number[i] & 0xff); in ata_disk_handler() 32 buf[js] = '\0'; in ata_disk_handler() 33 printk("%s", buf); in ata_disk_handler()
|
/DragonOS-0.1.8/kernel/src/driver/disk/ahci/ |
D | ahcidisk.rs | 57 buf: &mut [u8], in read_at() 61 if count * 512 > buf.len() || check_length > u16::MAX as usize { in read_at() 98 let mut buf_ptr = buf as *mut [u8] as *mut usize as usize; in read_at() 102 let user_buf = if unsafe { verify_area(buf_ptr as u64, buf.len() as u64) } { in read_at() 108 let mut x: Vec<u8> = Vec::with_capacity(buf.len()); in read_at() 110 x.set_len(buf.len()); in read_at() 204 buf.copy_from_slice(kbuf.as_ref().unwrap()); in read_at() 216 buf: &[u8], in write_at() 220 if count * 512 > buf.len() || check_length > u16::MAX as usize { in write_at() 260 let mut buf_ptr = buf as *const [u8] as *mut usize as usize; in write_at() [all …]
|
D | ahci_inode.rs | 119 buf: &mut [u8], in read_at() 122 if buf.len() < len { in read_at() 127 return self.0.lock().disk.read_at(offset, len, buf); in read_at() 138 buf: &[u8], in write_at() 141 if buf.len() < len { in write_at() 146 return self.0.lock().disk.write_at(offset, len, buf); in write_at()
|
/DragonOS-0.1.8/kernel/src/ipc/ |
D | pipe.rs | 79 buf: &mut [u8], in read_at() 82 if buf.len() < len { in read_at() 118 buf[0..(PIPE_BUFF_SIZE - start)].copy_from_slice(&inode.data[start..PIPE_BUFF_SIZE]); in read_at() 119 buf[(PIPE_BUFF_SIZE - start)..num].copy_from_slice(&inode.data[0..end]); in read_at() 121 buf[0..num].copy_from_slice(&inode.data[start..end]); in read_at() 158 buf: &[u8], in write_at() 161 if buf.len() < len || len > PIPE_BUFF_SIZE { in write_at() 190 inode.data[start..PIPE_BUFF_SIZE].copy_from_slice(&buf[0..(PIPE_BUFF_SIZE - start)]); in write_at() 191 inode.data[0..end].copy_from_slice(&buf[(PIPE_BUFF_SIZE - start)..len]); in write_at() 193 inode.data[start..end].copy_from_slice(&buf[0..len]); in write_at()
|
/DragonOS-0.1.8/kernel/src/io/ |
D | device.rs | 35 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, SystemError>; in read_at() 42 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, SystemError>; in write_at() 64 buf: &mut [u8], in read_at() 78 buf: &[u8], in write_at() 109 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, SystemError> { in read_at() 110 if len > buf.len() { in read_at() 121 let buf_slice = &mut buf[buf_begin..buf_end]; in read_at() 145 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, SystemError> { in write_at() 147 if len > buf.len() { in write_at() 157 let buf_slice = &buf[buf_begin..buf_end]; in write_at()
|
/DragonOS-0.1.8/kernel/src/filesystem/devfs/ |
D | zero_dev.rs | 113 buf: &mut [u8], in read_at() 116 if buf.len() < len { in read_at() 121 buf[i] = 0; in read_at() 132 buf: &[u8], in write_at() 135 if buf.len() < len { in write_at()
|
/DragonOS-0.1.8/user/libs/libc/src/include/export/ |
D | unistd.h | 25 ssize_t read(int fd, void *buf, size_t count); 35 ssize_t write(int fd, void const *buf, size_t count);
|
D | stdio.h | 50 int sprintf(char *buf, const char *fmt, ...); 51 int vsprintf(char *buf, const char *fmt, va_list args);
|