freebsd

What is a structure of u-boot flash file? ( ARM versatile pb )

戏子无情 提交于 2019-12-23 23:21:05
问题 I'm working on creating file that I can load with -kernel option of qemu. I mostly mind here u-boot config file that I have found information should be placed somewhere in file. That file have to contain u-boot binary, freebsd kernel and RTOS to run ( so i can choose which kernel to load or do some experimental developement in loading 2 OS at same time - eg. FreeBSD is loaded by u-boot and then FreeBSD loads FreeRTOS on 2nd core - so called ASMP ). It seems there is no tools around to do that

Generic Makefile not working on FreeBSD

依然范特西╮ 提交于 2019-12-23 13:24:29
问题 Please note that this is not a duplicate of the other questions named generic makefile. I have followed all of the instructions on other questions about generic makefiles, and this is the code I have come up with from that: CFLAGS = -c CC = cc SOURCES = $(wildcard *.cc) OBJECTS = $(patsubst %.cc,%.o,%(SOURCES)) EXEC = run all: build clean build: $(OBJECTS) $(CC) $(OBJECTS) -o $(EXEC) %.o: %.cc $(CC) $(CFLAGS) $< clean: rm *.o However, when I execute make with a file called test.cc in my

Generic Makefile not working on FreeBSD

假如想象 提交于 2019-12-23 13:24:24
问题 Please note that this is not a duplicate of the other questions named generic makefile. I have followed all of the instructions on other questions about generic makefiles, and this is the code I have come up with from that: CFLAGS = -c CC = cc SOURCES = $(wildcard *.cc) OBJECTS = $(patsubst %.cc,%.o,%(SOURCES)) EXEC = run all: build clean build: $(OBJECTS) $(CC) $(OBJECTS) -o $(EXEC) %.o: %.cc $(CC) $(CFLAGS) $< clean: rm *.o However, when I execute make with a file called test.cc in my

Access EIP and EBP via ucontext on OS X

时光总嘲笑我的痴心妄想 提交于 2019-12-23 12:38:47
问题 I am trying to port a tool to osx which is designed to run on linux and freebsd. There is a case in the program where access to the EIP and EBP is need. This is done via the ucontext. So i added a case for __APPLE__ to place a suitable access to the ucontext struct. 9887 #if defined(__FreeBSD__) 9888 *paddr = uc->uc_mcontext.mc_eip; 9889 #elif defined(__dietlibc__) 9890 *paddr = uc->uc_mcontext.eip; 9891 #elif defined(__APPLE__) 9892 *paddr = uc->uc_mcontext.ss.eip; 9893 #else 9894 *paddr =

POSIX: Pipe syscall in FreeBSD vs Linux

风格不统一 提交于 2019-12-23 08:17:10
问题 In Linux (2.6.35-22-generic), man pipe states that pipe() creates a pipe, a unidirectional data channel that can be used for interprocess communication." In FreeBSD (6.3-RELEASE-p5), man pipe states that The pipe() system call creates a pipe, which is an object allowing bidirectional data flow, and allocates a pair of file descriptors." One is unidirectional, the other is bidirectional. I hope this isn't a silly question, but which method is the standard way of doing this? Are they both POSIX

POSIX: Pipe syscall in FreeBSD vs Linux

荒凉一梦 提交于 2019-12-23 08:17:10
问题 In Linux (2.6.35-22-generic), man pipe states that pipe() creates a pipe, a unidirectional data channel that can be used for interprocess communication." In FreeBSD (6.3-RELEASE-p5), man pipe states that The pipe() system call creates a pipe, which is an object allowing bidirectional data flow, and allocates a pair of file descriptors." One is unidirectional, the other is bidirectional. I hope this isn't a silly question, but which method is the standard way of doing this? Are they both POSIX

vim system register * and + not working

江枫思渺然 提交于 2019-12-23 07:28:07
问题 :echo has('clipboard') returns 1, but whenever I execute "+yy" or "*yy" nothing seems to be in those registers. If I use regular yy to copy another line of text, then try to paste from the register using CONTROL+V nothing happens. If I try "+p vim pastes the line of text I copied using the regular yy command. What's going on here? I'm on FreeBSD by the way. 回答1: Your vim version may not be compiled with X11 clipboard integration. In vim run the :version command and look for xterm_clipboard in

Why does catching std::bad_cast not work on FreeBSD 9?

 ̄綄美尐妖づ 提交于 2019-12-23 07:11:50
问题 Consider this code (badcast.cpp): #include <exception> #include <typeinfo> #include <stdio.h> class foo { public: virtual ~foo() {} }; class bar: public foo { public: int val; bar(): val(123) {} }; static void cast_test(const foo &f) { try { const bar &b = dynamic_cast<const bar &>(f); printf("%d\n", b.val); } catch (const std::bad_cast &) { printf("bad cast\n"); } } int main() { foo f; cast_test(f); return 0; } FreeBSD 9.1: $ g++ badcast.cpp -o badcast -Wall && ./badcast terminate called

Adding stackless threading to BSD Kernel?

我与影子孤独终老i 提交于 2019-12-23 02:34:30
问题 IronPort developed a stackless threading model that allows the IronPort appliance to support more than 10,000 simultaneous connections in contrast to the 100 connections supported on a traditional OS. If one wanted to do the same but to make it open source, where should they start? 回答1: There are some implementations already available. Just do some digging around and you can find them. One of the most prevalent implementations is available under a BSD license: Protothreads 回答2: What you need

kill - does it kill the process right away?

二次信任 提交于 2019-12-22 09:00:12
问题 what does kill exactly do? I have a parent process which is creating 100 (as an example) child processes one after another. At the end of any child's job, I kill the child with kill(pid_of_child, SIGKILL) and I cannot see that in ps output. But if something goes wrong with the parent process and I exit from the parent process with exit(1) (at this point only 1 child is there - I can check tht in ps ), at that point I see a lot of <defunct> processes whose ppid is pid of parent process. How is