-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments for "https://os.phil-opp.com/integration-tests/" #443
Comments
Great stuff! |
In Additional Test Executables and Bootimage Test paragraphs the author mentions unit test, but judging by context, aren't those supposed be integration tests? |
Fist off thanks for the great tutorial! On my machine I seem to have to append --target x86_64-blog_os.json to all bootimage commands...not a huge deal, just curious if I am doing something obviously wrong. without the target called out specifically I get: |
@skierpage Thanks!
Yeah, I think so. Here is an incomplete list of the common port ranges. |
@phil-opp Woops, I definitely missed that :) Thanks!! |
Hello very good tutorial. Thanks for sharing this. One question popped up though: What is the purpose of using: #![feature(const_fn)] in |
I don't see it in |
Seems like it. Should be removed in 3365a4f. Thanks for reporting! |
@phil-opp , thank you for another great article. Could you please explain the reason of choosing the As far as I remember, UART allows a two-way communication... (and you've also mentioned that fact in the beginning of an article). P.S. explaining how to build a library and a "hybrid project" clearly adds some education value to the article. Still, please consider highlighting the pros and cons of different test framework implementation approaches. So far It's a bit unclear for the beginners (like me) P.P.S. I have created a dedicated issue #451 |
I followed the tutorial and found that #[cfg(test)]
extern crate std;
#[cfg(test)]
extern crate array_init; Since this was previously in |
Hello again @phil-opp :D, working again through your tutorial. I encountered one minor problem. Which i believe is just my in proper use of the tools. Nonetheless i've got a question: the qemu commandline option "-device isa-debug-exit,iobase=0xf4,iosize=0x04" i cannot find any concrete information about this option. could you please tell from where you got it? |
@nukeop It's included in the example code for #![no_std] // don't link the Rust standard library
...
#[cfg(test)]
extern crate array_init;
#[cfg(test)]
extern crate std;
... |
@nukeop As @mtn said, it is part of the code listing in the “Split Off A Library” section. |
@Johanneslueke It is mentioned in the “Shutdown” article of the OSDev wiki and this Stackoverflow answer. The official documentation is rather sparse unfortunately. You see it under "Misc devices" when executing |
I'm not exactly sure why this would be a reason to mark |
@ksqsf The code relies on two conditions: (1) There is a device attached at port 0xf4 and (2) this device is the QEMU shutdown device. Both conditions might not hold in a real system. In a really bad theoretical case there could a different device at that address that interprets the sent command as "overwrite some memory region via DMA", which would break memory safety. So because we cannot prove that this function is safe in all cases, we mark it as unsafe and use it only in the integration test scenario where we know that the QEMU device exists at that address. |
I am getting the following error : error: format argument must be a string literal Though if is use serial_println!("{}","ok") instead of serial_println!("ok") it works fine ???? |
You might be missing a |
I am having issue with your code in the "Split Off A Library" section, specifically the line:
I am getting this error when I run
|
@mdunnegan Do you have the In case you're using the older version in your code and don't want to update it, you can add a |
Hi @phil-opp, thank you for this wonderful series. I'm learning about OS as well as Rust. I've few questions/doubts if you could please help me with:
|
Hi @krsoninikhil,
Yes, you could do that if you are sure that you'll never have unit tests in these files. The disadvantage of this approach is that any tests that you might add in the future will be silently ignored. A better solution in my opinion would be to change the behavior of
No real reason. Seperation with
There is a difference between serial ports and I/O ports. I/O ports are the fundamental building block that can be used to read/write device registers. The serial port controller is such an device with multiple device registers. If you look at the source code of the I hope this answers your questions! |
Thanks @phil-opp for clarifying, this certainly helps. |
I am getting the following error when i run 'bootimage run' command: blog_os git:(post-05)> bootimage run --bin test-basic-boot -- Caused by: Caused by: Caused by: |
It does seem to come from the compiler itself. Maybe the rust toolchain you're using is broken ? |
@guidao Are you using |
@AntoineSebert @phil-opp yes, i am using rustup to manage my toolchains.
but libcompiler_builtin is not found in this directory |
@guidao Thanks! I think the problem is that your |
@phil-opp it's working. thanks. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
This is a general purpose comment thread for the “Integration Tests” post.
The text was updated successfully, but these errors were encountered: