Re: std::cin in Fiasco/L4Re (with 'make qemu')

"Stark, Josef" <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <0E9B8524CEB45345BDDC5443F04630D10546DC21@BADWLRZ-SWMBX13.ads.mwn.de>
Hi,

>I'm not sure where you enter this.
>For me, the following works quite fine:
>
>#include <stdio.h>
>
>int main(void)
>{
>  printf("Press some key: ");
>  char c = getchar();
>  printf("\nYour input: %c (%d)\n", c, c);
>
>  printf("Enter a number: ");
>  int number;
>  scanf("%x", &number);
>  printf("Your number: %d\n", number);
>
>  return 0;
>} 


If I copy this code into the hello example, and change the Makefile accordingly:

PKGDIR		?= ../..
L4DIR		?= $(PKGDIR)/../..
TARGET		= hello
SRC_C		= main.c
REQUIRES_LIBS   = libc_be_file_stdin
include $(L4DIR)/mk/prog.mk


I can successfully run it IF moe runs hello directly
(without Ned and a config, as a "make qemu E=hello" does).

If, however, hello is run through a config file and therefore Ned,
as in hello-cfg, it doesn't work. Execution does not halt and outputs
invalid values:

MOE: Starting: rom/ned rom/hello.cfg
MOE: loading 'rom/ned'
Ned says: Hi World!
Ned: loading file: 'rom/hello.cfg'
hello   | Press some key: 
hello   | Your input: � (-1)
hello   | Enter a number: Your number: -2147450972


How to make it work? Pass a certain capability to hello?

Josef
_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.